/**
 * 陕西_5G切片+DNN业务接口需求 V2.0
 * 解析脚本 宽表入库
 * xcw
 * 2022-06-09
 */


var input = configData;
// 全局打印日志开关
var flag = true;
// 列对象
var UPFList = new java.util.ArrayList();


// doAna();
function doAna() {
    print_info("================================================================================");
    print_info("=======================陕西_5G切片+DNN业务 json UPF开始解析=============================");
    print_info("================================================================================");

    var task_orderId = orderId;
    // 拿到json 数据
    var jsonObj = JSON.parse(input);
    print_info("jsonObj = " + JSON.stringify(jsonObj));
    var orderInfo = jsonObj;
    print_info("orderInfo-----" + JSON.stringify(orderInfo));
    if (orderInfo != undefined) {
        Analysis_Database_orderInfo(orderInfo, task_orderId);
    }
    return response;

}




// 第一层 json
function Analysis_Database_orderInfo(datas, task_orderId) {
    var ColumnMap = new java.util.HashMap();
    var dnnInfo = datas.dnnInfoList;

// 公共字段
    var orderId = datas.orderId;
    var provinceId = datas.provinceId;
    var deadline = datas.deadline;
    var BBOSSOrderId = datas.BBOSSOrderId;
    var BBOSSOrderSource = datas.BBOSSOrderSource;
    var packageType = datas.packageType;
    var usage = datas.usage;
    var snssai = datas.snssai;
    var snssaiClass = datas.snssaiClass;
    var description = datas.description;
    var snssaiCrossProvinceIs = datas.snssaiCrossProvinceIs;
    var businessScope = "";
    for (var i = 0; i < datas.businessScope.length; i++) {
        businessScope += datas.businessScope[i];
    }
    var snssaiAdd = datas.operatorInfo.snssaiAdd;
    ColumnMap.put("orderInfo_orderId", orderId);
    ColumnMap.put("orderInfo_provinceId", provinceId);
    ColumnMap.put("orderInfo_deadline", deadline);
    ColumnMap.put("orderInfo_BBOSSOrderId", BBOSSOrderId);
    ColumnMap.put("orderInfo_BBOSSOrderSource", BBOSSOrderSource);
    ColumnMap.put("orderInfo_packageType", packageType);
    ColumnMap.put("orderInfo_usage", usage);
    ColumnMap.put("orderInfo_snssai", snssai);
    ColumnMap.put("orderInfo_snssaiClass", snssaiClass);
    ColumnMap.put("orderInfo_description", description);
    ColumnMap.put("orderInfo_snssaiCrossProvinceIs", snssaiCrossProvinceIs);
    ColumnMap.put("orderInfo_businessScope", businessScope);
    ColumnMap.put("operatorInfo_snssaiAdd", snssaiAdd);
    // ---------------------------------------------------------------------------------------------
    var SST = getStd(snssai, 0);
    var SD = getStd(snssai, 1);
    var VPNINSTANCE = getVPNINSTANCE();
    var HASVPNIPV6 = getHASVPNIPV6();
    var SWITCH = getSWITCH();
    var SUPPORTIPV4 = getSUPPORTIPV4();
    var SUPPORTIPV6 = getSUPPORTIPV6();
    var FRAMEDROUTE = getFRAMEDROUTE();
    var ANTISPOOFINGDL = getANTISPOOFINGDL();
    var ANTISPOOFINGUL = getANTISPOOFINGUL();
    var IPTYPEFORDUALIP = getIPTYPEFORDUALIP();
    var SINGLEADDRCAUSE = getSINGLEADDRCAUSE();
    var CPCTRL = getCPCTRL();
    var IPV6RAMTUSW = getIPV6RAMTUSW();
    var IPV6RALIFETIME = getIPV6RALIFETIME();
    var HOSTROUTEIP = getHOSTROUTEIP();
    var IPLEASE = getIPLEASE();
    var SINGLEIPFLAG = getSINGLEIPFLAG();
    var HASVPN = getHASVPN();
    var IMSSW = getIMSSW();
    var IPV4ALLOCPRIALG = getIPV4ALLOCPRIALG();
    var IPV6ALLOCPRIALG = getIPV6ALLOCPRIALG();
    var FIRSTRULESW = getFIRSTRULESW();
    var FIRSTRULE = getFIRSTRULE();
    var SECONDRULESW = getSECONDRULESW();
    var THIRDRULESW = getTHIRDRULESW();
    var IPV6FIRSTRULESW = getIPV6FIRSTRULESW();
    var IPV6FIRSTRULE = getIPV6FIRSTRULE();
    var IPV6SECRULESW = getIPV6SECRULESW();
    var IPV6THIRDRULESW = getIPV6THIRDRULESW();
    var RULENAME = getRULENAME();
    var POLICYTYPE = getPOLICYTYPE();
    var V4TCPMSSVALUE = getV4TCPMSSVALUE();
    var V6TCPMSSVALUE = getV6TCPMSSVALUE();
    var SOFTPARATYPE = getSOFTPARATYPE();
    var SOFTPARAINDEX = getSOFTPARAINDEX();
    var SOFTPARANUM = getSOFTPARANUM();
    var AFTYPE = getAFTYPE();
    var IFIPmask_ipv4 = getIFIPmask_ipv4();
    var TNLTYPE = getTNLTYPE();
    var route_AFTYPE = getroute_AFTYPE();
    var PREFERENCE = getPREFERENCE();
    var PREFIX_ipv4 = getPREFIX_ipv4();
    var ZX_SST_SD = getZX_SST_SD(snssai);
    var ZX_SST = getStd(snssai, 0);
    var ZX_SD = getStd(snssai, 1);
    var ZX_REAL = getZX_REAL();
    var ZX_MS2MSMODE = getZX_MS2MSMODE();
    var ZX_PRIORITY = getZX_PRIORITY();
    var ZX_MAXPDPNUM = getZX_MAXPDPNUM();
    var ZX_USERPROFILETYPE = getZX_USERPROFILETYPE();
    var ZX_PRECEDENCE = getZX_PRECEDENCE();
    var ZX_DPIUPCONFIG = getZX_DPIUPCONFIG();
    var ZX_RULENAME = getZX_RULENAME();

    ColumnMap.put("SINGLEIPFLAG", SINGLEIPFLAG);
    ColumnMap.put("HASVPN", HASVPN);
    ColumnMap.put("IMSSW", IMSSW);
    ColumnMap.put("IPV4ALLOCPRIALG", IPV4ALLOCPRIALG);
    ColumnMap.put("IPV6ALLOCPRIALG", IPV6ALLOCPRIALG);
    ColumnMap.put("FIRSTRULESW", FIRSTRULESW);
    ColumnMap.put("FIRSTRULE", FIRSTRULE);
    ColumnMap.put("SECONDRULESW", SECONDRULESW);
    ColumnMap.put("THIRDRULESW", THIRDRULESW);
    ColumnMap.put("IPV6FIRSTRULESW", IPV6FIRSTRULESW);
    ColumnMap.put("IPV6FIRSTRULE", IPV6FIRSTRULE);
    ColumnMap.put("IPV6SECRULESW", IPV6SECRULESW);
    ColumnMap.put("IPV6THIRDRULESW", IPV6THIRDRULESW);
    ColumnMap.put("RULENAME", RULENAME);
    ColumnMap.put("POLICYTYPE", POLICYTYPE);
    ColumnMap.put("V4TCPMSSVALUE", V4TCPMSSVALUE);
    ColumnMap.put("V6TCPMSSVALUE", V6TCPMSSVALUE);
    ColumnMap.put("SOFTPARATYPE", SOFTPARATYPE);
    ColumnMap.put("SOFTPARAINDEX", SOFTPARAINDEX);
    ColumnMap.put("SOFTPARANUM", SOFTPARANUM);
    ColumnMap.put("AFTYPE", AFTYPE);
    ColumnMap.put("IFIPmask_ipv4", IFIPmask_ipv4);
    ColumnMap.put("TNLTYPE", TNLTYPE);
    ColumnMap.put("route_AFTYPE", route_AFTYPE);
    ColumnMap.put("PREFERENCE", PREFERENCE);
    ColumnMap.put("PREFIX_ipv4", PREFIX_ipv4);
    ColumnMap.put("ZX_SST_SD", ZX_SST_SD);
    ColumnMap.put("ZX_SST", ZX_SST);
    ColumnMap.put("ZX_SD", ZX_SD);
    ColumnMap.put("ZX_REAL", ZX_REAL);
    ColumnMap.put("ZX_MS2MSMODE", ZX_MS2MSMODE);
    ColumnMap.put("ZX_PRIORITY", ZX_PRIORITY);
    ColumnMap.put("ZX_MAXPDPNUM", ZX_MAXPDPNUM);
    ColumnMap.put("ZX_USERPROFILETYPE", ZX_USERPROFILETYPE);
    ColumnMap.put("ZX_PRECEDENCE", ZX_PRECEDENCE);
    ColumnMap.put("ZX_DPIUPCONFIG", ZX_DPIUPCONFIG);
    ColumnMap.put("ZX_RULENAME", ZX_RULENAME);
    ColumnMap.put("IPLEASE", IPLEASE);
    ColumnMap.put("CPCTRL", CPCTRL);
    ColumnMap.put("IPV6RAMTUSW", IPV6RAMTUSW);
    ColumnMap.put("IPV6RALIFETIME", IPV6RALIFETIME);
    ColumnMap.put("HOSTROUTEIP", HOSTROUTEIP);
    ColumnMap.put("SUPPORTIPV6", SUPPORTIPV6);
    ColumnMap.put("FRAMEDROUTE", FRAMEDROUTE);
    ColumnMap.put("ANTISPOOFINGDL", ANTISPOOFINGDL);
    ColumnMap.put("ANTISPOOFINGUL", ANTISPOOFINGUL);
    ColumnMap.put("IPTYPEFORDUALIP", IPTYPEFORDUALIP);
    ColumnMap.put("SINGLEADDRCAUSE", SINGLEADDRCAUSE);
    ColumnMap.put("SUPPORTIPV4", SUPPORTIPV4);
    ColumnMap.put("SWITCH", SWITCH);
    ColumnMap.put("HASVPNIPV6", HASVPNIPV6);
    ColumnMap.put("VPNINSTANCE", VPNINSTANCE);
    ColumnMap.put("SST", SST);
    ColumnMap.put("SD", SD);


// 数组1 公共字段
    var common1_array = new java.util.ArrayList();
    if (dnnInfo != undefined) {
        for (var i = 0; i < dnnInfo.length; i++) {
            var map = new java.util.HashMap();
            var dnnName = dnnInfo[i].dnnName;
            var dnnType = dnnInfo[i].dnnType;
            var upfDeploymentScope = "";
            for (var j = 0; j < (dnnInfo[i].upfDeploymentScope).length; j++) {
                upfDeploymentScope += (dnnInfo[i].upfDeploymentScope)[j] + "@";
            }
            // 浙江新增
            var IOVFlag = dnnInfo[i].IOVFlag;
            map.put("dnnInfoList_dnnName", dnnName);
            map.put("dnnInfoList_dnnType", dnnType);
            map.put("dnnInfoList_upfDeploymentScope", upfDeploymentScope);
            map.put("dnnInfoList_IOVFlag", IOVFlag);
            common1_array.add(map);
        }
    }

// 数组2 公共字段
    var common2_array = new java.util.ArrayList();
    var customerInfo = datas.customerInfoList;
    if (customerInfo != undefined) {
        for (var i = 0; i < customerInfo.length; i++) {
            var map = new java.util.HashMap();
            var classification = customerInfo[i].classification;
            var name = customerInfo[i].name;
            var id = customerInfo[i].id;
            var type = customerInfo[i].type;
            var address = customerInfo[i].address;
            var contact = customerInfo[i].contact;
            var contactTel = customerInfo[i].contactTel;
            map.put("customerInfoList_classification", classification);
            map.put("customerInfoList_name", name);
            map.put("customerInfoList_id", id);
            map.put("customerInfoList_type", type);
            map.put("customerInfoList_address", address);
            map.put("customerInfoList_contact", contact);
            map.put("customerInfoList_contactTel", contactTel);
            common2_array.add(map);
        }
    }

//--------------------------------------------------------特有方案--------------------------------------------------------------------
    var upf = datas.nfConfigTemplate.upfList;
    var upf_array1 = new java.util.ArrayList();
    var upf_array2 = new java.util.ArrayList();
    if (upf != undefined) {
        for (var i = 0; i < upf.length; i++) {
            var map = new java.util.HashMap();
            var upfName = upf[i].upfName;
            map.put("upfList_upfName", upfName);
            //----------------------------------------------------------------------------------------------------------
            var ZX_UPNAME = getZX_UPNAME(upfName);
            var d1 = upf[i].ipsecInfo.IpAdd;
            var d2 = upf[i].dnnInfoList.vpnId;
            var VRFRD_ZJ = getLUYOU(d1, d2);

            map.put("ZX_UPNAME", ZX_UPNAME);
            map.put("VRFRD_ZJ", VRFRD_ZJ);


            upf_array1.add(map);


            var upfDnn = upf[i].dnnInfoList;
            if (upfDnn != undefined) {
                for (var j = 0; j < upfDnn.length; j++) {
                    var map = new java.util.HashMap();

                    var dnnName = upfDnn[j].dnnName;
                    var vpnId = upfDnn[j].vpnId;
                    var vpnName = upfDnn[j].vpnName;
                    var protocolType = upfDnn[j].protocolType;

                    map.put("upfdnnInfoList_dnnName", dnnName);
                    map.put("upfdnnInfoList_vpnId", vpnId);
                    map.put("upfdnnInfoList_vpnName", vpnName);
                    map.put("upfdnnInfoList_protocolType", protocolType);
                    // ------------------------------------------------------------------------------
                    var HW_VPNINSTANCE_ZJ = getDNNSpecialname(vpnName);
                    var HW_VPNINSTANCEIPV6_ZJ = getDNNSpecialname(vpnName);
                    var HW_natInfo_VPNINSTANCE_ZJ = "VRF_Internet";
                    var HW_natInfo_VPNINSTANCEIPV6_ZJ = "VRF_Internet";
                    var ZTE_VRFNAME_ZJ = getDNNSpecialname(vpnName);

                    var ZTE_GRE_VRFDESCRIPTION_ZJ = getDNNSpecialname(vpnName);
                    var ZTE_nonTunnelInfo_VRFDESCRIPTION_ZJ = getDNNSpecialname(vpnName);
                    var APN = getDNNname(dnnName);

                    var POOLGRPNAME = getPOOLGRPNAME(dnnName);
                    var MAPPINGNAME = getMAPPINGNAME(dnnName);
                    var ZX_APNDNN = getZX_APNDNN(dnnName);
                    var USERPROFILENAME = getUSERPROFILENAME(dnnName);
                    var GREVPNINSTANCE = getGREVPNINSTANCE(dnnName);
                    var ZX_NETWORKINSTANCE = getZX_NETWORKINSTANCE(dnnName);
                    var ZX_VRFNAME = getZX_VRFNAME(dnnName);
                    var ZX_REALAPNDNN = getZX_REALAPNDNN(dnnName);
                    var ZX_USERNAME = getZX_USERNAME(dnnName);
                    var ZX_SNSSAINAME = dnnName.toString().replaceAll(".SN","");
                    var ZX_NETWORKINSTANCE_ZJ = getNAME(dnnName, vpnName);
                    var ZX_VRFNAME_ZJ = getZX_VRFNAME_ZJ(dnnName);
                    var ZX_VPNID_ZJ = vpnId;
                    var ZX_greinfo_IPPOOLNAME_ZJ = dealDnnName(dnnName);
                    var ZX_nonTunnelInfo_IPPOOLNAME_ZJ = dealDnnName(dnnName);
                    var ZX_natInfo_IPPOOLNAME_ZJ = dealDnnName(dnnName);
                    var ZX_ip_vrf_forwarding = getVPNDEALName(vpnName);
                    var ZX_tunnel_vrf = getVPNDEALName(vpnName);
                    var ZX_ip_route_vrf = getVPNDEALName(vpnName);
                    var ZX_description = getVPNDEALName(vpnName);
                    var HW_nonTunnelInfo_IFNAME_ZJ = getDataQUZGHI(vpnId);


                    map.put("HW_nonTunnelInfo_IFNAME_ZJ", HW_nonTunnelInfo_IFNAME_ZJ);
                    map.put("ZX_ip_route_vrf", ZX_ip_route_vrf);
                    map.put("ZX_tunnel_vrf", ZX_tunnel_vrf);
                    map.put("ZX_ip_vrf_forwarding", ZX_ip_vrf_forwarding);
                    map.put("ZX_description", ZX_description);
                    map.put("ZX_natInfo_IPPOOLNAME_ZJ", ZX_natInfo_IPPOOLNAME_ZJ);
                    map.put("ZX_nonTunnelInfo_IPPOOLNAME_ZJ", ZX_nonTunnelInfo_IPPOOLNAME_ZJ);
                    map.put("ZX_greinfo_IPPOOLNAME_ZJ", ZX_greinfo_IPPOOLNAME_ZJ);
                    map.put("ZX_VPNID_ZJ", ZX_VPNID_ZJ);
                    map.put("ZX_VRFNAME_ZJ", ZX_VRFNAME_ZJ);
                    map.put("ZX_NETWORKINSTANCE_ZJ", ZX_NETWORKINSTANCE_ZJ);
                    map.put("ZTE_nonTunnelInfo_VRFDESCRIPTION_ZJ", ZTE_nonTunnelInfo_VRFDESCRIPTION_ZJ);
                    map.put("ZTE_GRE_VRFDESCRIPTION_ZJ", ZTE_GRE_VRFDESCRIPTION_ZJ);
                    map.put("ZTE_VRFNAME_ZJ", ZTE_VRFNAME_ZJ);
                    map.put("HW_VPNINSTANCE_ZJ", HW_VPNINSTANCE_ZJ);
                    map.put("HW_VPNINSTANCEIPV6_ZJ", HW_VPNINSTANCEIPV6_ZJ);
                    map.put("HW_natInfo_VPNINSTANCE_ZJ", HW_natInfo_VPNINSTANCE_ZJ);
                    map.put("HW_natInfo_VPNINSTANCEIPV6_ZJ", HW_natInfo_VPNINSTANCEIPV6_ZJ);
                    map.put("ZX_SNSSAINAME", ZX_SNSSAINAME);
                    map.put("POOLGRPNAME", POOLGRPNAME);
                    map.put("MAPPINGNAME", MAPPINGNAME);
                    map.put("ZX_APNDNN", ZX_APNDNN);
                    map.put("USERPROFILENAME", USERPROFILENAME);
                    map.put("GREVPNINSTANCE", GREVPNINSTANCE);
                    map.put("ZX_NETWORKINSTANCE", ZX_NETWORKINSTANCE);
                    map.put("ZX_VRFNAME", ZX_VRFNAME);
                    map.put("ZX_REALAPNDNN", ZX_REALAPNDNN);
                    map.put("ZX_USERNAME", ZX_USERNAME);
                    map.put("APN", APN);

                    var natInfo = upfDnn[j].natInfo;
                    if (natInfo != undefined) {
                        var shareIpIs = natInfo.shareIpIs;
                        var terIpv4Name = natInfo.terIpv4Name;
                        var terIpv4Add = natInfo.terIpv4Add;
                        var terIpv6Name = natInfo.terIpv6Name;
                        var terIpv6Add = natInfo.terIpv6Add;
                        var dnsIs = natInfo.dnsIs;
                        var dnsAddress = natInfo.dnsAddress;
                        var dnsAddressV6 = natInfo.dnsAddressV6;
                        var remarks = natInfo.remarks;
                        map.put("natinfo_shareIpIs", shareIpIs);
                        map.put("natinfo_terIpv4Name", terIpv4Name);
                        map.put("natinfo_terIpv4Add", terIpv4Add);
                        map.put("natinfo_terIpv6Name", terIpv6Name);
                        map.put("natinfo_terIpv6Add", terIpv6Add);
                        map.put("natinfo_dnsIs", dnsIs);
                        map.put("natinfo_dnsAddress", dnsAddress);
                        map.put("natinfo_dnsAddressV6", dnsAddressV6);
                        map.put("natinfo_remarks", remarks);
                        // --------------------------------------------------------------------------------
                        var terIpv4Name_natInfo_POOLNAME = getterIpv4Name_natInfo_POOLNAME(dnnName, terIpv4Name);
                        var terIpv6Name_natInfo_POOLNAME = getterIpv6Name_natInfo_POOLNAME(dnnName, terIpv6Name);
                        var terIpv4Name_natInfo_IPVERSION = getterIpv4Name_natInfo_IPVERSION(terIpv4Name);
                        var terIpv6Name_natInfo_IPVERSION = getterIpv6Name_natInfo_IPVERSION(terIpv6Name);
                        var natInfo_TYPE = getnatInfo_TYPE();
                        var terIpv4Name_natInfo_RELEASETIME = getterIpv4Name_natInfo_RELEASETIME(terIpv4Name);
                        var terIpv6Name_natInfo_RELEASETIME = getterIpv6Name_natInfo_RELEASETIME(terIpv6Name);
                        var natInfo_V4STARTIP = getnatInfo_V4STARTIP(terIpv4Add);
                        var natInfo_V4ENDIP = getnatInfo_V4ENDIP(terIpv4Add);
                        var natInfo_V6PREFIXSTART = getnatInfo_V6PREFIXSTART(terIpv6Add);
                        var natInfo_V6PREFIXEND = getnatInfo_V6PREFIXEND(terIpv6Add);
                        var natInfo_V6PREFIXLENGTH = getnatInfo_V6PREFIXLENGTH(terIpv6Add);
                        var ZX_terIpv4Name_natInfo_IPPOOLNAME = getZX_terIpv4Name_natInfo_IPPOOLNAME(terIpv4Name);
                        var ZX_terIpv6Name_natInfo_IPPOOLNAME = getZX_terIpv6Name_natInfo_IPPOOLNAME(terIpv6Name);
                        var natInfo_ALARMSWITCH = getnatInfo_ALARMSWITCH();
                        var ZX_natInfo_IPPOOLATTR = getZX_natInfo_IPPOOLATTR();
                        var ZX_natInfo_NEEDDYNCROUTE = getZX_natInfo_NEEDDYNCROUTE();
                        var ZX_terIpv4Name_natInfo_IPTYPE = getZX_terIpv4Name_natInfo_IPTYPE(terIpv4Add);
                        var ZX_terIpv6Name_natInfo_IPTYPE = getZX_terIpv6Name_natInfo_IPTYPE(terIpv6Add);
                        var ZX_NFTRANSFERFLAG = getZX_NFTRANSFERFLAG();
                        var natInfo_V6PREFIX = getV6PREFIX(terIpv6Add);

                        var natInfo_V4PRIORITY = getTerIpv4Name(terIpv4Name);
                        var natInfo_V6PRIORITY = getTerIpv6Name(terIpv6Name);
                        var natInfo_MASK = getMasks(terIpv4Add);
                        var ZX_natInfo_SEGMENTNAMEv4  = getsegName(dnnName,terIpv4Add);
                        var ZX_natInfo_SEGMENTNAMEv6  = getsegNameV6(dnnName,terIpv6Add);

                        map.put("natInfo_V6PREFIX", natInfo_V6PREFIX);
                        map.put("natInfo_V4PRIORITY", natInfo_V4PRIORITY);
                        map.put("natInfo_V6PRIORITY", natInfo_V6PRIORITY);
                        map.put("natInfo_MASK", natInfo_MASK);
                        map.put("ZX_natInfo_SEGMENTNAMEv4", ZX_natInfo_SEGMENTNAMEv4);
                        map.put("ZX_natInfo_SEGMENTNAMEv6", ZX_natInfo_SEGMENTNAMEv6);

                        map.put("terIpv4Name_natInfo_RELEASETIME", terIpv4Name_natInfo_RELEASETIME);
                        map.put("terIpv6Name_natInfo_RELEASETIME", terIpv6Name_natInfo_RELEASETIME);
                        map.put("natInfo_V4STARTIP", natInfo_V4STARTIP);
                        map.put("natInfo_V4ENDIP", natInfo_V4ENDIP);
                        map.put("natInfo_V6PREFIXSTART", natInfo_V6PREFIXSTART);
                        map.put("natInfo_V6PREFIXEND", natInfo_V6PREFIXEND);
                        map.put("natInfo_V6PREFIXLENGTH", natInfo_V6PREFIXLENGTH);
                        map.put("ZX_terIpv4Name_natInfo_IPPOOLNAME", ZX_terIpv4Name_natInfo_IPPOOLNAME);
                        map.put("ZX_terIpv6Name_natInfo_IPPOOLNAME", ZX_terIpv6Name_natInfo_IPPOOLNAME);
                        map.put("natInfo_ALARMSWITCH", natInfo_ALARMSWITCH);
                        map.put("ZX_natInfo_IPPOOLATTR", ZX_natInfo_IPPOOLATTR);
                        map.put("ZX_natInfo_NEEDDYNCROUTE", ZX_natInfo_NEEDDYNCROUTE);
                        map.put("ZX_terIpv4Name_natInfo_IPTYPE", ZX_terIpv4Name_natInfo_IPTYPE);
                        map.put("ZX_terIpv6Name_natInfo_IPTYPE", ZX_terIpv6Name_natInfo_IPTYPE);
                        map.put("ZX_NFTRANSFERFLAG", ZX_NFTRANSFERFLAG);
                        map.put("natInfo_TYPE", natInfo_TYPE);
                        map.put("terIpv4Name_natInfo_POOLNAME", terIpv4Name_natInfo_POOLNAME);
                        map.put("terIpv6Name_natInfo_POOLNAME", terIpv6Name_natInfo_POOLNAME);
                        map.put("terIpv4Name_natInfo_IPVERSION", terIpv4Name_natInfo_IPVERSION);
                        map.put("terIpv6Name_natInfo_IPVERSION", terIpv6Name_natInfo_IPVERSION);
                    }
                    var ipsecInfo = upfDnn[j].ipsecInfo;
                    if (ipsecInfo != undefined) {
                        var tunnelID = ipsecInfo.tunnelID;
                        var terIpv4Name = ipsecInfo.terIpv4Name;
                        var terIpv4Add = ipsecInfo.terIpv4Add;
                        var terIpv6Name = ipsecInfo.terIpv6Name;
                        var terIpv6Add = ipsecInfo.terIpv6Add;
                        var staIpAddIs = ipsecInfo.staIpAddIs;
                        var radiusTemplate = ipsecInfo.radiusTemplate;
                        var dnsIs = ipsecInfo.dnsIs;
                        var dnsAddress = ipsecInfo.dnsAddress;
                        var firstEncryptMode = ipsecInfo.firstEncryptMode;
                        var firstValidateMode = ipsecInfo.firstValidateMode;
                        var firstSecretKey = ipsecInfo.firstSecretKey;
                        var firstPhrase = ipsecInfo.firstPhrase;
                        var firstDhGroup = ipsecInfo.firstDhGroup;
                        var secondEncryptMode = ipsecInfo.secondEncryptMode;
                        var secondValidateMode = ipsecInfo.secondValidateMode;
                        var secondPhrase = ipsecInfo.secondPhrase;
                        var secondPFSIs = ipsecInfo.secondPFSIs;
                        var secondDhGroup = ipsecInfo.secondDhGroup;
                        var interestIoOriginIpAddress = ipsecInfo.interestIoOriginIpAddress;
                        var interestIoAimIpAddress = ipsecInfo.interestIoAimIpAddress;
                        var dpdIs = ipsecInfo.dpdIs;
                        var NAT_TIs = ipsecInfo.NAT_TIs;
                        var tunnelMode = ipsecInfo.tunnelMod;
                        var IpAdd = ipsecInfo.IpAdd;
                        var mainInterIpAdd = ipsecInfo.mainInterIpAdd;
                        var reserveInterIpAdd = ipsecInfo.reserveInterIpAdd;
                        // 浙江新增
                        var dnsAddressV6 = ipsecInfo.dnsAddressV6;
                        var HW_greInfo_CHECKIPVALID = checkIsHeFa(staIpAddIs);
                        var HW_nonTunnelInfo_CHECKIPVALID = checkIsHeFa(staIpAddIs);
                        var HW_natInfo_CHECKIPVALID = checkIsHeFa(staIpAddIs);
                        var HW_AFTYPE_ZJ = checkISHASV4V6Name(terIpv4Name,terIpv6Name);
                        var HW_IFMTU_ZJ = 1500;
                        var HW_ADDRTYPE_ipv4 = "主地址";


                        map.put("HW_ADDRTYPE_ipv4", HW_ADDRTYPE_ipv4);
                        map.put("HW_IFMTU_ZJ", HW_IFMTU_ZJ);
                        map.put("HW_AFTYPE_ZJ", HW_AFTYPE_ZJ);
                        map.put("HW_natInfo_CHECKIPVALID", HW_natInfo_CHECKIPVALID);
                        map.put("HW_nonTunnelInfo_CHECKIPVALID", HW_nonTunnelInfo_CHECKIPVALID);
                        map.put("HW_greInfo_CHECKIPVALID", HW_greInfo_CHECKIPVALID);
                        map.put("ipsecInfo_tunnelID", tunnelID);
                        map.put("ipsecInfo_terIpv4Name", terIpv4Name);
                        map.put("ipsecInfo_terIpv4Add", terIpv4Add);
                        map.put("ipsecInfo_terIpv6Name", terIpv6Name);
                        map.put("ipsecInfo_terIpv6Add", terIpv6Add);
                        map.put("ipsecInfo_staIpAddIs", staIpAddIs);
                        map.put("ipsecInfo_radiusTemplate", radiusTemplate);
                        map.put("ipsecInfo_dnsIs", dnsIs);
                        map.put("ipsecInfo_dnsAddress", dnsAddress);
                        map.put("ipsecInfo_firstEncryptMode", firstEncryptMode);
                        map.put("ipsecInfo_firstValidateMode", firstValidateMode);
                        map.put("ipsecInfo_firstSecretKey", firstSecretKey);
                        map.put("ipsecInfo_firstPhrase", firstPhrase);
                        map.put("ipsecInfo_firstDhGroup", firstDhGroup);
                        map.put("ipsecInfo_secondEncryptMode", secondEncryptMode);
                        map.put("ipsecInfo_secondValidateMode", secondValidateMode);
                        map.put("ipsecInfo_secondPhrase", secondPhrase);
                        map.put("ipsecInfo_secondPFSIs", secondPFSIs);
                        map.put("ipsecInfo_secondDhGroup", secondDhGroup);
                        map.put("ipsecInfo_interestIoOriginIpAddress", interestIoOriginIpAddress);
                        map.put("ipsecInfo_interestIoAimIpAddress", interestIoAimIpAddress);
                        map.put("ipsecInfo_dpdIs", dpdIs);
                        map.put("ipsecInfo_NAT_TIs", NAT_TIs);
                        map.put("ipsecInfo_tunnelMode", tunnelMode);
                        map.put("ipsecInfo_IpAdd", IpAdd);
                        map.put("ipsecInfo_mainInterIpAdd", mainInterIpAdd);
                        map.put("ipsecInfo_reserveInterIpAdd", reserveInterIpAdd);
                        map.put("ipsecInfo_dnsAddressV6", dnsAddressV6);


                        var ipsecUserAddInfo = ipsecInfo.userAddInfo;
                        if (ipsecUserAddInfo != undefined) {
                            var mainInterIpAdd = ipsecUserAddInfo.mainInterIpAdd;
                            var reserveInterIpAdd = ipsecUserAddInfo.reserveInterIpAdd;
                            var mainIpAdd = ipsecUserAddInfo.mainIpAdd;
                            var reserveIpAdd = ipsecUserAddInfo.reserveIpAdd;
                            map.put("ipsecUserAddInfo_mainInterIpAdd", mainInterIpAdd);
                            map.put("ipsecUserAddInfo_reserveInterIpAdd", reserveInterIpAdd);
                            map.put("ipsecUserAddInfo_mainIpAdd", mainIpAdd);
                            map.put("ipsecUserAddInfo_reserveIpAdd", reserveIpAdd);
                        }
                    }

                    var greInfo = upfDnn[j].greInfo;
                    if (greInfo != undefined) {
                        var tunnelID = greInfo.tunnelID;
                        var terIpv4Name = greInfo.terIpv4Name;
                        var terIpv4Add = greInfo.terIpv4Add;
                        var terIpv6Name = greInfo.terIpv6Name;
                        var terIpv6Add = greInfo.terIpv6Add;
                        var staIpAddIs = greInfo.staIpAddIs;
                        var radiusTemplate = greInfo.radiusTemplate;
                        var dnsIs = greInfo.dnsIs;
                        var dnsAddress = greInfo.dnsAddress;
                        var backupTunnel = greInfo.backupTunnel;
                        var keepaliveIs = greInfo.keepaliveIs;
                        var keepalive = greInfo.keepalive;
                        var IpAdd = greInfo.IpAdd;
                        var mainInterIpAdd = greInfo.mainInterIpAdd;
                        var reserveInterIpAdd = greInfo.reserveInterIpAdd;
                        // 浙江新增
                        var dnsAddressV6 = greInfo.dnsAddressV6;

                        map.put("greInfo_tunnelID", tunnelID);
                        map.put("greInfo_terIpv4Name", terIpv4Name);
                        map.put("greInfo_terIpv4Add", terIpv4Add);
                        map.put("greInfo_terIpv6Name", terIpv6Name);
                        map.put("greInfo_terIpv6Add", terIpv6Add);
                        map.put("greInfo_staIpAddIs", staIpAddIs);
                        map.put("greInfo_radiusTemplate", radiusTemplate);
                        map.put("greInfo_dnsIs", dnsIs);
                        map.put("greInfo_backupTunnel", dnsAddress);
                        map.put("greInfo_keepaliveIs", backupTunnel);
                        map.put("greInfo_keepalive", keepaliveIs);
                        map.put("greInfo_IpAdd", keepalive);
                        map.put("greInfo_mainInterIpAdd", IpAdd);
                        map.put("greInfo_reserveInterIpAdd", mainInterIpAdd);
                        map.put("greInfo_dnsAddress", reserveInterIpAdd);
                        map.put("greInfo_dnsAddressV6", dnsAddressV6);
                        // ----------------------------------------------------------------------------------------
                        var ana_keepaliveIs = getkeepaliveIs(keepaliveIs);
                        var ana_Keepalive = getKeepalive(keepaliveIs);
                        var terIpv4Name_greInfo_POOLNAME = getterIpv4Name_greInfo_POOLNAME(dnnName, terIpv4Name);
                        var terIpv6Name_greInfo_POOLNAME = getterIpv6Name_greInfo_POOLNAME(dnnName, terIpv6Name);
                        var terIpv4Name_greinfo_IPVERSION = terIpv4Name;
                        var terIpv6Name_greinfo_IPVERSION = terIpv6Name;
                        var greInfo_TYPE = staIpAddIs.toString().trim();
                        var terIpv4Name_greInfo_RELEASETIME = getterIpv4Name_greInfo_RELEASETIME(terIpv4Name);
                        var terIpv6Name_greInfo_RELEASETIME = getterIpv6Name_greInfo_RELEASETIME(terIpv6Name);
                        var greInfo_ALARMSWITCH = getgreInfo_ALARMSWITCH(staIpAddIs.toString().trim());
                        var greInfo_V4STARTIP = getIgreInfo_V4STARTIP(terIpv4Add);
                        var greInfo_V4ENDIP = getgreInfo_V4ENDIP(terIpv4Add);
                        var greInfo_V6PREFIXSTART = getgreInfo_V6PREFIXSTART(terIpv6Add);
                        var greInfo_V6PREFIXEND = getgreInfo_V6PREFIXEND(terIpv6Add);
                        var greInfo_V6PREFIXLENGTH = getgreInfo_V6PREFIXLENGTH(terIpv6Add);
                        var VRFRD = getVRFRD(IpAdd);
                        var TNLNAME = getTNLNAME(tunnelID);
                        var IFIPADDR_ipv4 = getIFIPADDR_ipv4(mainInterIpAdd);
                        var Unreachable = getUnreachable(keepaliveIs);
                        var endTOend = getendTOend(keepaliveIs);
                        var ZX_terIpv4Name_greinfo_IPPOOLNAME = getZX_terIpv4Name_greinfo_IPPOOLNAME(terIpv4Name);
                        var ZX_terIpv6Name_greinfo_IPPOOLNAME = getZX_terIpv6Name_greinfo_IPPOOLNAME(terIpv6Name);
                        var ZX_greinfo_IPPOOLATTR = getZX_greinfo_IPPOOLATTR(staIpAddIs.toString().trim());
                        var ZX_greinfo_NEEDDYNCROUTE = getZX_greinfo_NEEDDYNCROUTE(staIpAddIs.toString().trim());
                        var ZX_terIpv4Name_greinfo_IPTYPE = getZX_terIpv4Name_greinfo_IPTYPE(terIpv4Add);
                        var ZX_terIpv6Name_greinfo_IPTYPE = getZX_terIpv6Name_greinfo_IPTYPE(terIpv6Add);
                        var IpAdd = greInfo.IpAdd;
                        var ZX_gre_tunnelID = getZX_gre_tunnelID(tunnelID);
                        var greInfo_V4PRIORITY = getTerIpv4Name(terIpv4Name);
                        var greInfo_V6PRIORITY = getTerIpv6Name(terIpv6Name);
                        var  ZX_ipaddress = mainInterIpAdd;
                        var  ZX_TunnelSourceipv4 = IpAdd;
                        var ZX_keepalive = keepalive;
                        var greInfo_MASK = getMasks(terIpv4Add);
                        var ZX_greInfo_SEGMENTNAMEv4  = getsegName(dnnName,terIpv4Add);
                        var ZX_greInfo_SEGMENTNAMEv6  = getsegNameV6(dnnName,terIpv6Add);
                        var greInfo_V6PREFIX = getV6PREFIX(terIpv6Add);

                        map.put("greInfo_V6PREFIX", greInfo_V6PREFIX);
                        map.put("greInfo_V4PRIORITY", greInfo_V4PRIORITY);
                        map.put("greInfo_V6PRIORITY", greInfo_V6PRIORITY);
                        map.put("ZX_ipaddress", ZX_ipaddress);
                        map.put("ZX_TunnelSourceipv4", ZX_TunnelSourceipv4);
                        map.put("ZX_keepalive", ZX_keepalive);
                        map.put("greInfo_MASK", greInfo_MASK);
                        map.put("ZX_greInfo_SEGMENTNAMEv4", ZX_greInfo_SEGMENTNAMEv4);
                        map.put("ZX_greInfo_SEGMENTNAMEv6", ZX_greInfo_SEGMENTNAMEv6);

                        map.put("keepaliveIs", ana_keepaliveIs);
                        map.put("keepalive", ana_Keepalive);
                        map.put("terIpv4Name_greInfo_POOLNAME", terIpv4Name_greInfo_POOLNAME);
                        map.put("terIpv6Name_greInfo_POOLNAME", terIpv6Name_greInfo_POOLNAME);
                        map.put("terIpv4Name_greinfo_IPVERSION", terIpv4Name_greinfo_IPVERSION);
                        map.put("terIpv6Name_greinfo_IPVERSION", terIpv6Name_greinfo_IPVERSION);
                        map.put("greInfo_TYPE", greInfo_TYPE);
                        map.put("terIpv4Name_greInfo_RELEASETIME", terIpv4Name_greInfo_RELEASETIME);
                        map.put("terIpv6Name_greInfo_RELEASETIME", terIpv6Name_greInfo_RELEASETIME);
                        map.put("greInfo_ALARMSWITCH", greInfo_ALARMSWITCH);
                        map.put("greInfo_V4STARTIP", greInfo_V4STARTIP);
                        map.put("greInfo_V4ENDIP", greInfo_V4ENDIP);
                        map.put("greInfo_V6PREFIXSTART", greInfo_V6PREFIXSTART);
                        map.put("greInfo_V6PREFIXEND", greInfo_V6PREFIXEND);
                        map.put("greInfo_V6PREFIXLENGTH", greInfo_V6PREFIXLENGTH);
                        map.put("VRFRD", VRFRD);
                        map.put("TNLNAME", TNLNAME);
                        map.put("IFIPADDR_ipv4", IFIPADDR_ipv4);
                        map.put("Unreachable", Unreachable);
                        map.put("endTOend", endTOend);
                        map.put("ZX_terIpv4Name_greinfo_IPPOOLNAME", ZX_terIpv4Name_greinfo_IPPOOLNAME);
                        map.put("ZX_terIpv6Name_greinfo_IPPOOLNAME", ZX_terIpv6Name_greinfo_IPPOOLNAME);
                        map.put("ZX_greinfo_IPPOOLATTR", ZX_greinfo_IPPOOLATTR);
                        map.put("ZX_greinfo_NEEDDYNCROUTE", ZX_greinfo_NEEDDYNCROUTE);
                        map.put("ZX_terIpv4Name_greinfo_IPTYPE", ZX_terIpv4Name_greinfo_IPTYPE);
                        map.put("ZX_terIpv6Name_greinfo_IPTYPE", ZX_terIpv6Name_greinfo_IPTYPE);
                        map.put("ZX_gre_tunnelID", ZX_gre_tunnelID);
                        map.put("IpAdd", IpAdd);


                        map.put("greInfo_TYPE", greInfo_TYPE);
                        map.put("terIpv4Name_greInfo_POOLNAME", terIpv4Name_greInfo_POOLNAME);
                        map.put("terIpv6Name_greInfo_POOLNAME", terIpv6Name_greInfo_POOLNAME);
                        map.put("terIpv4Name_greinfo_IPVERSION", terIpv4Name_greinfo_IPVERSION);
                        map.put("terIpv6Name_greinfo_IPVERSION", terIpv6Name_greinfo_IPVERSION);

                        var userAddInfo = greInfo.userAddInfo;
                        if (userAddInfo != undefined) {
                            var mainInterIpAdds = userAddInfo.mainInterIpAdd;
                            var reserveInterIpAdds = userAddInfo.reserveInterIpAdd;
                            var mainIpAdd = userAddInfo.mainIpAdd;
                            var reserveIpAdd = userAddInfo.reserveIpAdd;

                            var ZX_TunnelDestinationipv4 = mainIpAdd;
                            map.put("ZX_TunnelDestinationipv4", ZX_TunnelDestinationipv4)

                            map.put("greInfouserAddInfo_mainInterIpAdd", mainInterIpAdds)
                            map.put("greInfouserAddInfo_reserveInterIpAdd", reserveInterIpAdds)
                            map.put("greInfouserAddInfo_mainIpAdd", mainIpAdd)
                            map.put("greInfouserAddInfo_reserveIpAdd", reserveIpAdd)
                            // ---------------------------------------------------------------------
                            var DSTIPADDR = getDSTIPADDR(userAddInfo.mainIpAdd);
                            map.put("DSTIPADDR", DSTIPADDR);
                        }

                    }
                    var l2tpInfo = upfDnn[j].l2tpInfo;
                    if (l2tpInfo != undefined) {
                        var tunnelMode = l2tpInfo.tunnelMode;
                        var authMode = l2tpInfo.authMode;
                        var l2tpSecretKey = l2tpInfo.l2tpSecretKey;
                        var coreNetworkTrans = l2tpInfo.coreNetworkTrans;
                        var addReuse = l2tpInfo.addReuse;
                        var reuseAccount = l2tpInfo.reuseAccount;
                        var groupId = l2tpInfo.groupId;
                        var lacAddres = l2tpInfo.lacAddres;
                        map.put("l2tpInfo_tunnelMode", tunnelMode);
                        map.put("l2tpInfo_authMode", authMode);
                        map.put("l2tpInfo_l2tpSecretKey", l2tpSecretKey);
                        map.put("l2tpInfo_coreNetworkTrans", coreNetworkTrans);
                        map.put("l2tpInfo_addReuse", addReuse);
                        map.put("l2tpInfo_reuseAccount", reuseAccount);
                        map.put("l2tpInfo_groupId", groupId);
                        map.put("l2tpInfo_lacAddres", lacAddres);

                        var l2tpUserAddInfo = l2tpInfo.userAddInfo;
                        if (l2tpUserAddInfo != undefined) {
                            var ipAdd = l2tpUserAddInfo.ipAdd;
                            var mainIpAdd = l2tpUserAddInfo.mainIpAdd;
                            var reserveIpAdd = l2tpUserAddInfo.reserveIpAdd;
                            var pollingList = l2tpUserAddInfo.pollingList;
                            map.put("l2tpInfouserAddInfo_ipAdd", ipAdd);
                            map.put("l2tpInfouserAddInfo_mainIpAdd", mainIpAdd);
                            map.put("l2tpInfouserAddInfo_reserveIpAdd", reserveIpAdd);
                            map.put("l2tpInfouserAddInfo_pollingList", pollingList);
                        }
                    }

                    var nonTunnelInfo = upfDnn[j].nonTunnelInfo;
                    if (nonTunnelInfo != undefined) {
                        var terIpv4Name = nonTunnelInfo.terIpv4Name;
                        var terIpv4Add = nonTunnelInfo.terIpv4Add;
                        var terIpv6Name = nonTunnelInfo.terIpv6Name;
                        var terIpv6Add = nonTunnelInfo.terIpv6Add;
                        var staIpAddIs = nonTunnelInfo.staIpAddIs;
                        var radiusTemplate = nonTunnelInfo.radiusTemplate;
                        var dnsIs = nonTunnelInfo.dnsIs;
                        var dnsAddress = nonTunnelInfo.dnsAddress;
                        var dnsAddressV6 = nonTunnelInfo.dnsAddressV6;
                        var remarks = nonTunnelInfo.remarks;
                        map.put("nonTunnelInfo_terIpv4Name", terIpv4Name);
                        map.put("nonTunnelInfo_terIpv4Add", terIpv4Add);
                        map.put("nonTunnelInfo_terIpv6Name", terIpv6Name);
                        map.put("nonTunnelInfo_terIpv6Add", terIpv6Add);
                        map.put("nonTunnelInfo_staIpAddIs", staIpAddIs);
                        map.put("nonTunnelInfo_radiusTemplate", radiusTemplate);
                        map.put("nonTunnelInfo_dnsIs", dnsIs);
                        map.put("nonTunnelInfo_dnsAddress", dnsAddress);
                        map.put("nonTunnelInfo_dnsAddressV6", dnsAddressV6);
                        map.put("nonTunnelInfo_remarks", remarks);
                        //-----------------------------------------------------------------------------------
                        var terIpv4Name_nonTunnelInfo_POOLNAME = getterIpv4Name_nonTunnelInfo_POOLNAME(dnnName, terIpv4Name);
                        var terIpv6Name_nonTunnelInfo_POOLNAME = getterIpv6Name_nonTunnelInfo_POOLNAME(dnnName, terIpv6Name);
                        var terIpv4Name_nonTunnelInfo_IPVERSION = getterIpv4Name_nonTunnelInfo_IPVERSION(terIpv4Name);
                        var terIpv6Name_nonTunnelInfo_IPVERSION = getterIpv6Name_nonTunnelInfo_IPVERSION(terIpv6Name);
                        var nonTunnelInfo_TYPE = getnonTunnelInfo_TYPE(staIpAddIs);
                        var terIpv4Name_nonTunnelInfo_RELEASETIME = getterIpv4Name_nonTunnelInfo_RELEASETIME(terIpv4Name);
                        var terIpv6Name_nonTunnelInfo_RELEASETIME = getterIpv6Name_nonTunnelInfo_RELEASETIME(terIpv6Name);
                        var nonTunnelInfo_ALARMSWITCH = getnonTunnelInfo_ALARMSWITCH(staIpAddIs.toString().trim());
                        var nonTunnelInfo_V4STARTIP = getnonTunnelInfo_V4STARTIP(terIpv4Add);
                        var nonTunnelInfo_V4ENDIP = getnonTunnelInfo_V4ENDIP(terIpv4Add);
                        var nonTunnelInfo_V6PREFIXSTART = getnonTunnelInfo_V6PREFIXSTART(terIpv6Add);
                        var nonTunnelInfo_V6PREFIXEND = getnonTunnelInfo_V6PREFIXEND(terIpv6Add);
                        var nonTunnelInfo_V6PREFIXLENGTH = getgetnatInfo_V6PREFIXLENGTH(terIpv6Add);
                        var ZX_terIpv4Name_nonTunnelInfo_IPPOOLNAME = getZX_terIpv4Name_nonTunnelInfo_IPPOOLNAME(terIpv4Name);
                        var ZX_terIpv6Name_nonTunnelInfo_IPPOOLNAME = getZX_terIpv6Name_nonTunnelInfo_IPPOOLNAME(terIpv6Name);
                        var ZX_nonTunnelInfo_IPPOOLATTR = getZX_greinfo_IPPOOLATTR(staIpAddIs.toString().trim());
                        var ZX_nonTunnelInfo_NEEDDYNCROUTE = getZX_nonTunnelInfo_NEEDDYNCROUTE(staIpAddIs.toString().trim());
                        var ZX_terIpv4Name_nonTunnelInfo_IPTYPE = getZX_terIpv4Name_nonTunnelInfo_IPTYPE(terIpv4Add);
                        var ZX_terIpv6Name_nonTunnelInfo_IPTYPE = getZX_terIpv6Name_nonTunnelInfo_IPTYPE(terIpv6Add);
                        var nonTunnelInfo_V6PREFIX = getV6PREFIX(terIpv6Add);

                        var nonTunnelInfo_V4PRIORITY = getTerIpv4Name(terIpv4Name);
                        var nonTunnelInfo_V6PRIORITY = getTerIpv6Name(terIpv6Name);
                        var nonTunnelInfo_MASK = getMasks(terIpv4Add);
                        var ZX_nonTunnelInfo_SEGMENTNAMEv4  = getsegName(dnnName,terIpv4Add);
                        var ZX_nonTunnelInfo_SEGMENTNAMEv6  = getsegNameV6(dnnName,terIpv6Add);

                        map.put("nonTunnelInfo_V6PREFIX", nonTunnelInfo_V6PREFIX);
                        map.put("nonTunnelInfo_V4PRIORITY", nonTunnelInfo_V4PRIORITY);
                        map.put("nonTunnelInfo_V6PRIORITY", nonTunnelInfo_V6PRIORITY);
                        map.put("nonTunnelInfo_MASK", nonTunnelInfo_MASK);
                        map.put("ZX_nonTunnelInfo_SEGMENTNAMEv4", ZX_nonTunnelInfo_SEGMENTNAMEv4);
                        map.put("ZX_nonTunnelInfo_SEGMENTNAMEv6", ZX_nonTunnelInfo_SEGMENTNAMEv6);

                        map.put("terIpv4Name_nonTunnelInfo_RELEASETIME", terIpv4Name_nonTunnelInfo_RELEASETIME);
                        map.put("terIpv6Name_nonTunnelInfo_RELEASETIME", terIpv6Name_nonTunnelInfo_RELEASETIME);
                        map.put("nonTunnelInfo_ALARMSWITCH", nonTunnelInfo_ALARMSWITCH);
                        map.put("nonTunnelInfo_V4STARTIP", nonTunnelInfo_V4STARTIP);
                        map.put("nonTunnelInfo_V4ENDIP", nonTunnelInfo_V4ENDIP);
                        map.put("nonTunnelInfo_V6PREFIXSTART", nonTunnelInfo_V6PREFIXSTART);
                        map.put("nonTunnelInfo_V6PREFIXEND", nonTunnelInfo_V6PREFIXEND);
                        map.put("nonTunnelInfo_V6PREFIXLENGTH", nonTunnelInfo_V6PREFIXLENGTH);
                        map.put("ZX_terIpv4Name_nonTunnelInfo_IPPOOLNAME", ZX_terIpv4Name_nonTunnelInfo_IPPOOLNAME);
                        map.put("ZX_terIpv6Name_nonTunnelInfo_IPPOOLNAME", ZX_terIpv6Name_nonTunnelInfo_IPPOOLNAME);
                        map.put("ZX_nonTunnelInfo_IPPOOLATTR", ZX_nonTunnelInfo_IPPOOLATTR);
                        map.put("ZX_nonTunnelInfo_NEEDDYNCROUTE", ZX_nonTunnelInfo_NEEDDYNCROUTE);
                        map.put("ZX_terIpv4Name_nonTunnelInfo_IPTYPE", ZX_terIpv4Name_nonTunnelInfo_IPTYPE);
                        map.put("ZX_terIpv6Name_nonTunnelInfo_IPTYPE", ZX_terIpv6Name_nonTunnelInfo_IPTYPE);
                        map.put("nonTunnelInfo_TYPE", nonTunnelInfo_TYPE);
                        map.put("terIpv4Name_nonTunnelInfo_POOLNAME", terIpv4Name_nonTunnelInfo_POOLNAME);
                        map.put("terIpv6Name_nonTunnelInfo_POOLNAME", terIpv6Name_nonTunnelInfo_POOLNAME);
                        map.put("terIpv4Name_nonTunnelInfo_IPVERSION", terIpv4Name_nonTunnelInfo_IPVERSION);
                        map.put("terIpv6Name_nonTunnelInfo_IPVERSION", terIpv6Name_nonTunnelInfo_IPVERSION);
                    }
                    upf_array2.add(map);
                }
            }
        }
    }

// UPF #############################网元入库##############################################
    if (!(upf_array1.size() > 0)) {
        response = "UPF数据不存在！";
        return;
    }

    for (var i = 0; i < common1_array.size(); i++) {
        var map_common1 = com.ponshine.common.util.MapUtils.mapsTomap(ColumnMap, common1_array.get(i));
        for (var j = 0; j < common2_array.size(); j++) {
            var map_common2 = com.ponshine.common.util.MapUtils.mapsTomap(map_common1, common2_array.get(j));
            for (var k = 0; k < upf_array1.size(); k++) {
                var map_upf_array1 = com.ponshine.common.util.MapUtils.mapsTomap(map_common2, upf_array1.get(k));
                for (var l = 0; l < upf_array2.size(); l++) {
                    var map_upf_array2 = com.ponshine.common.util.MapUtils.mapsTomap(map_upf_array1, upf_array2.get(l));
                    // 去除map中的undefined值
                    for (var m = 0; m < (map_upf_array2.keySet().toArray()).length; m++) {
                        if (map_upf_array2.get((map_upf_array2.keySet().toArray())[m]) == undefined) {
                            map_upf_array2.put((map_upf_array2.keySet().toArray())[m], "");
                        }
                    }
                    UPFList.add(map_upf_array2);
                }
            }

        }
    }
    print_info("集合--" + UPFList);
    if (UPFList.size() > 0) {
        var flag = com.ponshine.common.util.JDBCJSJUtil.insertTableNameFirstColumnNum(jt, "MYSQL", "`core_data`.bureau_data_ana_data_upf", UPFList, 100);
        var flag1 = com.ponshine.common.util.JDBCJSJUtil.insertTableNameFirstColumnNum(jt, "MYSQL", "`core_data`.bureau_std_data_upf", UPFList, 100);
        print_info("是否插入成功--" + flag);
        print_info("是否插入成功--" + flag1);
    }
}

function print_info(comment) {
    if (flag) {
        print(comment + "\n");
    }
}

function getTerIpv4Name(terIpv4Name) {
    if ("" == terIpv4Name || null == terIpv4Name || undefined == terIpv4Name) {
        return "";
    }
    return "11";
}
function getTerIpv6Name(terIpv6Name) {
    if ("" == terIpv6Name || null == terIpv6Name || undefined == terIpv6Name) {
        return "";
    }
    return "10";
}
function getsegName(dnnName,terIpv4Add) {
    if (terIpv4Add ==""|| terIpv4Add == null || terIpv4Add == undefined){
        return "";
    }
    var name = "";
    var split = terIpv4Add.split(",");
    for (var i = 0; i <split.length; i++) {
        var number = i + 1;
        name = name + "seg" + number + "v4-" + dnnName.toString().toUpperCase() + ",";
    }
    var substring = name.substring(0, name.length - 1);
    return substring;
}
function getsegNameV6(dnnName,terIpv6Add) {
    if (terIpv6Add ==""|| terIpv6Add == null || terIpv6Add == undefined){
        return "";
    }
    var name = "";
    var split = terIpv6Add.split(",");
    for (var i = 0; i <split.length; i++) {
        var number = i + 1;
        name = name + "seg" + number + "v6-" + dnnName.toString().toUpperCase() + ",";
    }
    var substring = name.substring(0, name.length - 1);
    return substring;
}
//1. createBusinessConfig下orderInfo中的snssai 1 是 SD 0是 SST
//数据库对应字段 SD  SST
function getStd(str, isSD) {
    var length = str.length;
    var indexOf = str.indexOf("-");
    if (isSD == 1) {
        var substring = str.substring(indexOf + 1, length);
        return substring;
    } else if (isSD == 0) {
        var substring = str.substring(0, indexOf - 1);
        return substring;
    }
}

//取upfList-dnnInfoList标准数据中的DNNname，转换成大写
//数据库对应字段 APN
function getDNNname(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = DNNname.toUpperCase();
    }
    return getDnnName;
}

// 取标准数据中的DNNname，转换成大写去掉中间的.后拼装。IP信息根据(upfList-dnnInfoList-greInfo)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值IPV4，若terIpv6Name存在值，取值IPV6。terIpv4Name、terIpv6Name都存在获取IPV4和IPV6两个值，生成两个标准
//数据库字段 terIpv4Name_greInfo_POOLNAME
function getterIpv4Name_greInfo_POOLNAME(DNNname, terIpv4Name) {
    var terIpv4Name_greInfo_POOLNAME = getIpv4NameAndIpv6Name(DNNname, terIpv4Name, "");
    return terIpv4Name_greInfo_POOLNAME;
}

//数据库字段 terIpv6Name_greInfo_POOLNAME
function getterIpv6Name_greInfo_POOLNAME(DNNname, terIpv6Name) {
    var getterIpv6Name_greInfo_POOLNAME = getIpv4NameAndIpv6Name(DNNname, "", terIpv6Name);
    return getterIpv6Name_greInfo_POOLNAME;
}

function getIpv4NameAndIpv6Name(DNNname, terIpv4Name, terIpv6Name) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = DNNname.toUpperCase().replace(".", "");
    } else {
        return getDnnName;
    }
    if (terIpv4Name != null && terIpv4Name != "") {
        getDnnName = "pool_" + getDnnName + "_ipv4" + "";
        return getDnnName;
    }
    if (terIpv6Name != null && terIpv6Name != "") {
        getDnnName = "pool_" + getDnnName + "_ipv6";
        return getDnnName;
    }
    return "";
}


// 取(upfList-dnnInfoList)标准数据中的DNNname，转换成大写去掉中间的.后拼装。IP信息根据(upfList-dnnInfoList-natInfo)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值IPV4，若terIpv6Name存在值，取值IPV6。terIpv4Name、terIpv6Name都存在获取IPV4和IPV6两个值
//数据库字段 terIpv4Name_natInfo_POOLNAME
function getterIpv4Name_natInfo_POOLNAME(DNNname, terIpv4Name) {
    var terIpv4Name_natInfo_POOLNAME = getIpv4NameAndIpv6Name(DNNname, terIpv4Name, "");
    return terIpv4Name_natInfo_POOLNAME;
}

//数据库字段 terIpv6Name_natInfo_POOLNAME
function getterIpv6Name_natInfo_POOLNAME(DNNname, terIpv6Name) {
    var terIpv6Name_natInfo_POOLNAME = getIpv4NameAndIpv6Name(DNNname, "", terIpv6Name);
    return terIpv6Name_natInfo_POOLNAME;
}

// 取标准(upfList-dnnInfoList)数据中的DNNname，转换成大写去掉中间的.后拼装。IP信息根据(upfList-dnnInfoList-nonTunnelInfo)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值IPV4，若terIpv6Name存在值，取值IPV6。terIpv4Name、terIpv6Name都存在获取IPV4和IPV6两个，生成两个标准值
//数据库字段 terIpv4Name_natInfo_POOLNAME
function getterIpv4Name_nonTunnelInfo_POOLNAME(DNNname, terIpv4Name) {
    var terIpv4Name_nonTunnelInfo_POOLNAME = getIpv4NameAndIpv6Name(DNNname, terIpv4Name, "");
    return terIpv4Name_nonTunnelInfo_POOLNAME;
}

//数据库字段 terIpv6Name_nonTunnelInfo_POOLNAME
function getterIpv6Name_nonTunnelInfo_POOLNAME(DNNname, terIpv6Name) {
    var terIpv6Name_nonTunnelInfo_POOLNAME = getIpv4NameAndIpv6Name(DNNname, "", terIpv6Name);
    return terIpv6Name_nonTunnelInfo_POOLNAME;
}


// 根据(upfList-dnnInfoList-greInfo)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值IPV4，若terIpv6Name存在值，取值IPV6。terIpv4Name、terIpv6Name都存在获取IPV4和IPV6两个值，生成两个标准
//数据库对应字段 terIpv4Name_greinfo_IPVERSION
function getterIpv4Name_greinfo_IPVERSION(terIpv4Name) {
    return getIPVERSIONName(terIpv4Name, "");
}

//数据库对应字段 terIpv6Name_greinfo_IPVERSION
function getterIpv6Name_greinfo_IPVERSION(terIpv6Name) {
    return getIPVERSIONName("", terIpv6Name);
}

//根据(upfList-dnnInfoList-natInfo)标准数据中的terIpv4Name、terIpv6Name，若terIpv4Name存在值，取值IPV4，
// 若terIpv6Name存在值，取值IPV6。terIpv4Name、terIpv6Name都存在获取IPV4和IPV6两个值，生成两个标准
//数据库对应字段 terIpv4Name_natInfo_IPVERSION
function getterIpv4Name_natInfo_IPVERSION(terIpv4Name) {
    return getIPVERSIONName(terIpv4Name, "");
}

//数据库对应字段 terIpv6Name_natInfo_IPVERSION
function getterIpv6Name_natInfo_IPVERSION(terIpv6Name) {
    return getIPVERSIONName("", terIpv6Name);
}

//根据(upfList-dnnInfoList-nonTunnelInfo)标准数据中的terIpv4Name、terIpv6Name，若terIpv4Name存在值，取值IPV4，
// 若terIpv6Name存在值，取值IPV6。terIpv4Name、terIpv6Name都存在获取IPV4和IPV6两个值，生成两个标准
//数据库对应字段 terIpv4Name_nonTunnelInfo_IPVERSION
function getterIpv4Name_nonTunnelInfo_IPVERSION(terIpv4Name) {
    return getIPVERSIONName(terIpv4Name, "");
}

//数据库对应字段 terIpv6Name_nonTunnelInfo_IPVERSION
function getterIpv6Name_nonTunnelInfo_IPVERSION(terIpv6Name) {
    return getIPVERSIONName("", terIpv6Name);
}

function getIPVERSIONName(terIpv4Name, terIpv6Name) {
    var getDnnName = "";
    if (terIpv4Name != null && terIpv4Name != "") {
        getDnnName = "IPV4";
    }
    if (terIpv6Name != null && terIpv6Name != "") {
        getDnnName = "IPV6";
    }
    return getDnnName;
}

// 根据(upfList-dnnInfoList-greInfo-staIpAddIs)标准数据中的“是否静态地址”字段值判断。1的时候取值EXTENAL  0的时候取值LOCAL 。
//数据库对应字段 greInfo_TYPE
function getgreInfo_TYPE(staIpAddIs) {
    var getDnnName = "";
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 1) {
        getDnnName = "EXTENAL";
    }
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 0) {
        getDnnName = "LOCAL";
    }
    return getDnnName;
}

//natInfo_TYPE
function getnatInfo_TYPE() {
    return "LOCAL";
}

// 根据(upfList-dnnInfoList-greInfo-staIpAddIs)标准数据中的“是否静态地址”字段值判断。1的时候取值EXTENAL  0的时候取值LOCAL 。
//数据库对应字段 nonTunnelInfo_TYPE
function getnonTunnelInfo_TYPE(staIpAddIs) {
    var getDnnName = "";
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 1) {
        getDnnName = "EXTENAL";
    }
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 0) {
        getDnnName = "LOCAL";
    }
    return getDnnName;
}

//数据库对应字段 IPLEASE
function getIPLEASE() {
    return "不使能";
}


function getRELEASETIMEName(terIpv4Name, terIpv6Name) {
    var getDnnName = "";
    if (terIpv4Name != null && terIpv4Name != "") {
        getDnnName = "60";
    }
    if (terIpv6Name != null && terIpv6Name != "") {
        getDnnName = "360";
    }
    return getDnnName;
}


//根据(upfList-dnnInfoList-greInfo)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值60，若terIpv6Name存在值，取值360。terIpv4Name、terIpv6Name都存在获取60和360两个值，生成两个标准
//数据库对应字段 terIpv4Name_greInfo_RELEASETIME
function getterIpv4Name_greInfo_RELEASETIME(terIpv4Name) {
    return getRELEASETIMEName(terIpv4Name, "");
}

//数据库对应字段 terIpv6Name_greInfo_RELEASETIME
function getterIpv6Name_greInfo_RELEASETIME(terIpv6Name) {
    return getRELEASETIMEName("", terIpv6Name);
}

//根据(upfList-dnnInfoList-natInfo)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值60，若terIpv6Name存在值，取值360。terIpv4Name、terIpv6Name都存在获取60和360两个值，生成两个标准
//数据库对应字段 terIpv4Name_natInfo_RELEASETIME
function getterIpv4Name_natInfo_RELEASETIME(terIpv4Name) {
    return getRELEASETIMEName(terIpv4Name, "");
}

//数据库对应字段 terIpv6Name_natInfo_RELEASETIME
function getterIpv6Name_natInfo_RELEASETIME(terIpv6Name) {
    return getRELEASETIMEName("", terIpv6Name);
}

//根据(upfList-dnnInfoList-nonTunnelInfo)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值60，若terIpv6Name存在值，取值360。terIpv4Name、terIpv6Name都存在获取60和360两个值，生成两个标准
//数据库对应字段 terIpv4Name_nonTunnelInfo_RELEASETIME
function getterIpv4Name_nonTunnelInfo_RELEASETIME(terIpv4Name) {
    return getRELEASETIMEName(terIpv4Name, "");
}

//数据库对应字段 terIpv6Name_nonTunnelInfo_RELEASETIME
function getterIpv6Name_nonTunnelInfo_RELEASETIME(terIpv6Name) {
    return getRELEASETIMEName("", terIpv6Name);
}

//数据库对应字段 SINGLEIPFLAG
function getSINGLEIPFLAG() {
    return "";
}

//数据库对应字段 HASVPN
function getHASVPN() {
    return "使能";
}

//根据(upfList-dnnInfoList-greInfo-staIpAddIs)工单中的“是否静态地址”字段值判断。1：是，0：否。 1的时候取值 不使能，0的时候取值 使能
//数据库对应字段 greInfo_ALARMSWITCH
function getgreInfo_ALARMSWITCH(staIpAddIs) {
    var getDnnName = "";
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 1) {
        getDnnName = "不使能";
    }
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 0) {
        getDnnName = "使能";
    }
    return getDnnName;
}

//数据库对应字段 natInfo_ALARMSWITCH
function getnatInfo_ALARMSWITCH() {
    return "使能";
}

//根据(upfList-dnnInfoList-nonTunnelInfo-staIpAddIs)工单中的“是否静态地址”字段值判断。1：是，0：否。 1的时候取值 不使能，0的时候取值 使能
//数据库对应字段 nonTunnelInfo_ALARMSWITCH
function getnonTunnelInfo_ALARMSWITCH(staIpAddIs) {
    var getDnnName = "";
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 1) {
        getDnnName = "不使能";
    }
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 0) {
        getDnnName = "使能";
    }
    return getDnnName;
}

//数据库对应字段 IMSSW
function getIMSSW() {
    return "使能";
}

// 通过(upfList-dnnInfoList-greInfo-terIpv4Add)标准数据【terIpv4Add】根据给出的IP地址段和掩码计算获得地址段起始地址，该字段信息存在多个值
//数据库对应字段 greInfo_V4STARTIP
function getIgreInfo_V4STARTIP(terIpv4Add) {
    var getDnnName = "";
    if (terIpv4Add != null && terIpv4Add != "") {
        var split = [];
        split = terIpv4Add.split(",");
        for (var i = 0; i < split.length; i++) {
            var ipAdd1 = split[i];
            var convertIpAdd1 = convertIpAdd("", ipAdd1);
            getDnnName = getDnnName + convertIpAdd1[0] + ",";
        }
        return getDnnName.substring(0, getDnnName.length - 1);
    }
}

// 通过(upfList-dnnInfoList-natInfo-terIpv4Add)标准数据【terIpv4Add】根据给出的IP地址段和掩码计算获得地址段起始地址，该字段信息存在多个值
//数据库对应字段 natInfo_V4STARTIP
function getnatInfo_V4STARTIP(terIpv4Add) {
    var getDnnName = "";
    if (terIpv4Add != null && terIpv4Add != "") {
        var split = [];
        split = terIpv4Add.split(",");
        for (var i = 0; i < split.length; i++) {
            var ipAdd1 = split[i];
            var convertIpAdd1 = convertIpAdd("", ipAdd1);
            getDnnName = getDnnName + convertIpAdd1[0] + ",";
        }
        return getDnnName.substring(0, getDnnName.length - 1);
    }
}

// 通过(upfList-dnnInfoList-natInfo-terIpv4Add)标准数据【terIpv4Add】根据给出的IP地址段和掩码计算获得地址段起始地址，该字段信息存在多个值
//数据库对应字段 nonTunnelInfo_V4STARTIP
function getnonTunnelInfo_V4STARTIP(terIpv4Add) {
    var getDnnName = "";
    if (terIpv4Add != null && terIpv4Add != "") {
        var split = [];
        split = terIpv4Add.split(",");
        for (var i = 0; i < split.length; i++) {
            var ipAdd1 = split[i];
            var convertIpAdd1 = convertIpAdd("", ipAdd1);
            getDnnName = getDnnName + convertIpAdd1[0] + ",";
        }
        return getDnnName.substring(0, getDnnName.length - 1);
    }
}

//通过(upfList-dnnInfoList-greInfo-terIpv4Add)标准数据【terIpv4Add】根据给出的IP地址段和掩码计算获得地址段结束地址，该字段信息存在多个值
//数据库对应字段 greInfo_V4ENDIP
function getgreInfo_V4ENDIP(terIpv4Add) {
    var getDnnName = "";
    if (terIpv4Add != null && terIpv4Add != "") {
        var split = [];
        split = terIpv4Add.split(",");
        for (var i = 0; i < split.length; i++) {
            var ipAdd1 = split[i];
            var convertIpAdd1 = convertIpAdd("", ipAdd1);
            getDnnName = getDnnName + convertIpAdd1[1] + ",";
        }
        return getDnnName.substring(0, getDnnName.length - 1);
    }
}

//通过(upfList-dnnInfoList-natInfo-terIpv4Add)标准数据【terIpv4Add】根据给出的IP地址段和掩码计算获得地址段结束地址，该字段信息存在多个值
//数据库对应字段 natInfo_V4ENDIP
function getnatInfo_V4ENDIP(terIpv4Add) {
    var getDnnName = "";
    if (terIpv4Add != null && terIpv4Add != "") {
        var split = [];
        split = terIpv4Add.split(",");
        for (var i = 0; i < split.length; i++) {
            var ipAdd1 = split[i];
            var convertIpAdd1 = convertIpAdd("", ipAdd1);
            getDnnName = getDnnName + convertIpAdd1[1] + ",";
        }
        return getDnnName.substring(0, getDnnName.length - 1);
    }
}

//通过(upfList-dnnInfoList-nonTunnelInfo-terIpv4Add)标准数据【terIpv4Add】根据给出的IP地址段和掩码计算获得地址段结束地址，该字段信息存在多个值
//数据库对应字段 nonTunnelInfo_V4ENDIP
function getnonTunnelInfo_V4ENDIP(terIpv4Add) {
    var getDnnName = "";
    if (terIpv4Add != null && terIpv4Add != "") {
        var split = [];
        split = terIpv4Add.split(",");
        for (var i = 0; i < split.length; i++) {
            var ipAdd1 = split[i];
            var convertIpAdd1 = convertIpAdd("", ipAdd1);
            getDnnName = getDnnName + convertIpAdd1[1] + ",";
        }
        return getDnnName.substring(0, getDnnName.length - 1);
    }
}

//通过(upfList-dnnInfoList-greInfo-terIpv6Add)标准数据【terIpv6Add】根据给出的IP地址段和掩码计算获得地址段起始IPV6地址，该字段信息存在多个值
//数据库对应字段 greInfo_V6PREFIXSTART
function getgreInfo_V6PREFIXSTART(terIpv6Add) {

    if (terIpv6Add == null || !terIpv6Add.contains("/")) {
        return "";
    }
    var getDnnName = "";
    var split = [];
    split = terIpv6Add.split(",");
    for (var i = 0; i < split.length; i++) {
        var ipAdd = split[i];
        var ipv6 = com.ponshine.ordermanage.util.IPV6Util.parseAbbreviationToFullIPv6(ipAdd.split("/")[0]);
        var mask = com.ponshine.ordermanage.util.IPV6Util.ipv6mask_int_to_string(Number(ipAdd.split("/")[1]));
        var ipv6StartAndEndIp = com.ponshine.ordermanage.util.IPV6Util.getIpv6StartAndEndIp(ipv6, mask);
        getDnnName = getDnnName + ipv6StartAndEndIp.get("startIp").toString() + ",";
    }
    return getDnnName.substring(0, getDnnName.length - 1);
}

//通过(upfList-dnnInfoList-natInfo-terIpv6Add)标准数据【terIpv6Add】根据给出的IP地址段和掩码计算获得地址段起始IPV6地址，该字段信息存在多个值
//数据库对应字段 natInfo_V6PREFIXSTART
function getnatInfo_V6PREFIXSTART(terIpv6Add) {
    if (terIpv6Add == null || !terIpv6Add.contains("/")) {
        return "";
    }
    var getDnnName = "";
    var split = [];
    split = terIpv6Add.split(",");
    for (var i = 0; i < split.length; i++) {
        var ipAdd = split[i];
        print_info(ipAdd)
        var ipv6 = com.ponshine.ordermanage.util.IPV6Util.parseAbbreviationToFullIPv6(ipAdd.split("/")[0]);
        var mask = com.ponshine.ordermanage.util.IPV6Util.ipv6mask_int_to_string(Number(ipAdd.split("/")[1]));
        var ipv6StartAndEndIp = com.ponshine.ordermanage.util.IPV6Util.getIpv6StartAndEndIp(ipv6, mask);
        getDnnName = getDnnName + ipv6StartAndEndIp.get("startIp").toString() + ",";
    }
    return getDnnName.substring(0, getDnnName.length - 1);
}

//通过(upfList-dnnInfoList-nonTunnelInfo-terIpv6Add)标准数据【terIpv6Add】根据给出的IP地址段和掩码计算获得地址段起始IPV6地址，该字段信息存在多个值
//数据库对应字段 nonTunnelInfo_V6PREFIXSTART
function getnonTunnelInfo_V6PREFIXSTART(terIpv6Add) {
    if (terIpv6Add == null || !terIpv6Add.contains("/")) {
        return "";
    }
    var getDnnName = "";
    var split = [];
    split = terIpv6Add.split(",");
    for (var i = 0; i < split.length; i++) {
        var ipAdd = split[i];
        var ipv6 = com.ponshine.ordermanage.util.IPV6Util.parseAbbreviationToFullIPv6(ipAdd.split("/")[0]);
        var mask = com.ponshine.ordermanage.util.IPV6Util.ipv6mask_int_to_string(Number(ipAdd.split("/")[1]));
        var ipv6StartAndEndIp = com.ponshine.ordermanage.util.IPV6Util.getIpv6StartAndEndIp(ipv6, mask);
        getDnnName = getDnnName + ipv6StartAndEndIp.get("startIp").toString() + ",";
    }
    return getDnnName.substring(0, getDnnName.length - 1);
}

//通过(upfList-dnnInfoList-greInfo-terIpv6Add)标准数据【terIpv6Add】根据给出的IP地址段和掩码计算获得地址段起始IPV6地址，该字段信息存在多个值
//数据库对应字段 greInfo_V6PREFIXEND
function getgreInfo_V6PREFIXEND(terIpv6Add) {
    if (terIpv6Add == null || !terIpv6Add.contains("/")) {
        return "";
    }
    var getDnnName = "";
    var split = [];
    split = terIpv6Add.split(",");
    for (var i = 0; i < split.length; i++) {
        var ipAdd = split[i];
        var ipv6 = com.ponshine.ordermanage.util.IPV6Util.parseAbbreviationToFullIPv6(ipAdd.split("/")[0]);
        var mask = com.ponshine.ordermanage.util.IPV6Util.ipv6mask_int_to_string(Number(ipAdd.split("/")[1]));
        var ipv6StartAndEndIp = com.ponshine.ordermanage.util.IPV6Util.getIpv6StartAndEndIp(ipv6, mask);
        getDnnName = getDnnName + ipv6StartAndEndIp.get("endIp").toString() + ",";
    }
    return getDnnName.substring(0, getDnnName.length - 1);
}

//通过(upfList-dnnInfoList-natInfo-terIpv6Add)标准数据【terIpv6Add】根据给出的IP地址段和掩码计算获得地址段起始IPV6地址，该字段信息存在多个值
//数据库对应字段 natInfo_V6PREFIXEND
function getnatInfo_V6PREFIXEND(terIpv6Add) {
    if (terIpv6Add == null || !terIpv6Add.contains("/")) {
        return "";
    }
    var getDnnName = "";
    var split = [];
    split = terIpv6Add.split(",");
    for (var i = 0; i < split.length; i++) {
        var ipAdd = split[i];
        var ipv6 = com.ponshine.ordermanage.util.IPV6Util.parseAbbreviationToFullIPv6(ipAdd.split("/")[0]);
        var mask = com.ponshine.ordermanage.util.IPV6Util.ipv6mask_int_to_string(Number(ipAdd.split("/")[1]));
        var ipv6StartAndEndIp = com.ponshine.ordermanage.util.IPV6Util.getIpv6StartAndEndIp(ipv6, mask);
        getDnnName = getDnnName + ipv6StartAndEndIp.get("endIp").toString() + ",";
    }
    return getDnnName.substring(0, getDnnName.length - 1);
}

//通过(upfList-dnnInfoList-nonTunnelInfo-terIpv6Add)标准数据【terIpv6Add】根据给出的IP地址段和掩码计算获得地址段起始IPV6地址，该字段信息存在多个值
//数据库对应字段 nonTunnelInfo_V6PREFIXEND
function getnonTunnelInfo_V6PREFIXEND(terIpv6Add) {
    if (terIpv6Add == null || !terIpv6Add.contains("/")) {
        return "";
    }
    var getDnnName = "";
    var split = [];
    split = terIpv6Add.split(",");
    for (var i = 0; i < split.length; i++) {
        var ipAdd = split[i];
        var ipv6 = com.ponshine.ordermanage.util.IPV6Util.parseAbbreviationToFullIPv6(ipAdd.split("/")[0]);
        var mask = com.ponshine.ordermanage.util.IPV6Util.ipv6mask_int_to_string(Number(ipAdd.split("/")[1]));
        var ipv6StartAndEndIp = com.ponshine.ordermanage.util.IPV6Util.getIpv6StartAndEndIp(ipv6, mask);
        getDnnName = getDnnName + ipv6StartAndEndIp.get("endIp").toString() + ",";
    }
    return getDnnName.substring(0, getDnnName.length - 1);
}

//通过(upfList-dnnInfoList-greInfo-terIpv6Add)标准数据【terIpv6Add】根据给出的IP地址段和掩码计算获得地址段起始IPV6地址，该字段信息存在多个值
//数据库对应字段 greInfo_V6PREFIXLENGTH
function getgreInfo_V6PREFIXLENGTH(terIpv6Add) {
    var getDnnName = "";
    var split = [];
    split = terIpv6Add.split(",");
    for (var i = 0; i < split.length; i++) {
        getDnnName = getDnnName + split[i].split("/")[1] + ",";
    }
    return getDnnName.substring(0, getDnnName.length - 1);
}

//通过(upfList-dnnInfoList-natInfo-terIpv6Add)标准数据【terIpv6Add】根据给出的IP地址段和掩码计算获得地址段起始IPV6地址，该字段信息存在多个值
//数据库对应字段 natInfo_V6PREFIXLENGTH
function getnatInfo_V6PREFIXLENGTH(terIpv6Add) {
    var getDnnName = "";
    var split = [];
    split = terIpv6Add.split(",");
    for (var i = 0; i < split.length; i++) {
        getDnnName = getDnnName + split[i].split("/")[1] + ",";
    }
    return getDnnName.substring(0, getDnnName.length - 1);
}

//通过(upfList-dnnInfoList-nonTunnelInfo-terIpv6Add)标准数据【terIpv6Add】根据给出的IP地址段和掩码计算获得地址段起始IPV6地址，该字段信息存在多个值
//数据库对应字段 nonTunnelInfo_V6PREFIXLENGTH
function getgetnatInfo_V6PREFIXLENGTH(terIpv6Add) {
    if (terIpv6Add == null) {
        return '';
    }
    var getDnnName = "";
    var split = [];
    split = terIpv6Add.split(",");
    for (var i = 0; i < split.length; i++) {
        getDnnName = getDnnName + split[i].split("/")[1] + ",";
    }
    return getDnnName.substring(0, getDnnName.length - 1);
}

function convertIpAdd(ipType, ipAdd) {
    if (ipAdd == null || !ipAdd.contains("/")) {
        return [];
    }
    var resultMap = [];
    var ipTypeLength = 8;
    var start_ip = "IPV4_start";
    var end_ip = "IPV4_end";
    var splitType = "."
    var radixType = 10;
    if (ipType == "IPV6") {
        ipTypeLength = 16;
        start_ip = "IPV6_start";
        end_ip = "IPV6_end";
        splitType = ":"
        radixType = 16;
    }
    var temp = ipAdd.split("/");
    if (temp.length == 2) {
        var resultStr = ""
        var partNumber = [];
        if (temp[0].indexOf("::") > -1) {
            var specialHex = temp[0].split("::")[0].split(splitType);
            for (var i = 0; i < specialHex.length; i++) {
                partNumber.push(specialHex[i]);
            }
            for (var j = specialHex.length; j < 8; j++) {
                partNumber.push("0000");
            }
        } else {
            partNumber = temp[0].split(splitType);
        }
        for (var i = 0; i < partNumber.length; i++) {
            var value = parseInt(partNumber[i], radixType).toString(2);
            for (var j = value.length; j < ipTypeLength; j++) {
                value = "0" + value;     //不够的就在前面补0
            }
            resultStr = resultStr + value;
        }

        var start_ip_add_str = "" + resultStr.substring(0, Number(temp[1]));
        var end_ip_add_str = "" + resultStr.substring(0, Number(temp[1]));
        for (var z = Number(temp[1]); z < resultStr.length; z++) {
            start_ip_add_str = start_ip_add_str + "0";
            end_ip_add_str = end_ip_add_str + "1";
        }
        var count_time = start_ip_add_str.length / ipTypeLength;
        var start_ip_add = [];
        var end_ip_add = [];
        for (var a = 0; a < count_time; a++) {
            start_ip_add.push(parseInt(start_ip_add_str.substring(a * ipTypeLength, (a + 1) * ipTypeLength), 2).toString(radixType));
            end_ip_add.push(parseInt(end_ip_add_str.substring(a * ipTypeLength, (a + 1) * ipTypeLength), 2).toString(radixType));
        }
        var mask = "";
        mask = com.ponshine.ordermanage.util.IPV6Util.ipv6mask_int_to_string(Number(temp[1]))
        resultMap.push(start_ip_add.join("."));
        resultMap.push(end_ip_add.join("."));
        resultMap.push(mask);
    }
    return resultMap;
}

//取(upfList-dnnInfoList-dnnName)标准数据中的DNNname，转换成大写去掉中间的.后拼装
//数据库对应值  POOLGRPNAME
function getPOOLGRPNAME(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = "pgrp_"+DNNname.toUpperCase().replace(".", "");
    }
    return getDnnName;
}

//数据库对应字段 IPV4ALLOCPRIALG
function getIPV4ALLOCPRIALG() {
    return "使能";
}

//数据库对应字段 IPV6ALLOCPRIALG
function getIPV6ALLOCPRIALG() {
    return "使能";
}

function getPRIORITYName(terIpv4Name, terIpv6Name) {
    var getDnnName = "";
    if (terIpv4Name != null && terIpv4Name != "") {
        getDnnName = "11";
    }
    if (terIpv6Name != null && terIpv6Name != "") {
        getDnnName = "10";
    }
    if (terIpv6Name != null && terIpv6Name != "" && terIpv4Name != null && terIpv4Name != "") {
        getDnnName = "11,10";
    }
    return getDnnName;
}

//根据(upfList-greInfo-terIpv4Name、terIpv6Name)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值11，若terIpv6Name存在值，取值10。terIpv4Name、terIpv6Name都存在获取11和10两个值，生成两个标准
//数据库对应字段 greInfo_PRIORITY
function getgreInfo_PRIORITY(terIpv4Name, terIpv6Name) {
    return getPRIORITYName(terIpv4Name, terIpv6Name);
}

//根据(upfList-natInfo-terIpv4Name、terIpv6Name)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值11，若terIpv6Name存在值，取值10。terIpv4Name、terIpv6Name都存在获取11和10两个值，生成两个标准
//数据库对应字段 natInfo_PRIORITY
function getnatInfo_PRIORITY(terIpv4Name, terIpv6Name) {
    return getPRIORITYName(terIpv4Name, terIpv6Name);
}

//根据(upfList-nonTunnelInfo-terIpv4Name、terIpv6Name)标准数据中的terIpv4Name、terIpv6Name，
// 若terIpv4Name存在值，取值11，若terIpv6Name存在值，取值10。terIpv4Name、terIpv6Name都存在获取11和10两个值，生成两个标准
//数据库对应字段 nonTunnelInfo_PRIORITY
function getnonTunnelInfo_PRIORITY(terIpv4Name, terIpv6Name) {
    return getPRIORITYName(terIpv4Name, terIpv6Name);
}

//取(upfList-dnnInfoList-dnnName)标准数据中的DNNname，转换成大写去掉中间的.后拼装
//数据库对应值  MAPPINGNAME
function getMAPPINGNAME(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = "map_" + DNNname.toUpperCase().replace(".", "");
    }
    return getDnnName;
}

//数据库对应字段 FIRSTRULESW
function getFIRSTRULESW() {
    return "使能";
}

//数据库对应字段 FIRSTRULE
function getFIRSTRULE() {
    return "APN";
}

//数据库对应字段 SECONDRULESW
function getSECONDRULESW() {
    return "不使能 ";
}

//数据库对应字段 THIRDRULESW
function getTHIRDRULESW() {
    return "不使能 ";
}

//数据库对应字段 IPV6FIRSTRULESW
function getIPV6FIRSTRULESW() {
    return "不使能 ";
}

//数据库对应字段 IPV6FIRSTRULE
function getIPV6FIRSTRULE() {
    return "使能 ";
}

//数据库对应字段 IPV6SECRULESW
function getIPV6SECRULESW() {
    return "APN";
}

//数据库对应字段 IPV6THIRDRULESW
function getIPV6THIRDRULESW() {
    return "不使能";
}

//取(upfList-dnnInfoList-dnnName)标准数据中的DNNname，转换成大写去掉中间的.后拼装
//数据库对应字段 USERPROFILENAME
function getUSERPROFILENAME(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = "u_p_cmcc_" + DNNname.toUpperCase().split(".")[0];
    }
    return getDnnName;
}

//数据库对应字段 RULENAME
function getRULENAME() {
    return "cmiot5g_any";
}

//数据库对应字段 POLICYTYPE
function getPOLICYTYPE() {
    return "PCC";
}

//数据库对应字段 V4TCPMSSVALUE
function getV4TCPMSSVALUE() {
    return "1380";
}

//数据库对应字段 V6TCPMSSVALUE
function getV6TCPMSSVALUE() {
    return "1300";
}

//数据库对应字段 SOFTPARATYPE
function getSOFTPARATYPE() {
    return "字节";
}

//数据库对应字段 SOFTPARAINDEX
function getSOFTPARAINDEX() {
    return "44";
}

//数据库对应字段 SOFTPARANUM
function getSOFTPARANUM() {
    return "4";
}

//取标准数据中的DNNname，转换成大写去掉.SN，在前面加上固定字段VRF_N6_Internet_
//数据库对应字段 GREVPNINSTANCE
function getGREVPNINSTANCE(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = "VRF_N6_Internet_" + DNNname.toUpperCase().split(".")[0];
    }
    return getDnnName;
}

//数据库对应字段 AFTYPE
function getAFTYPE() {
    return "IPv4单播";
}

//取(upfList-greInfo-IpAdd)标准数据中【IpAdd（核心网侧隧道源地址）】+“:100”
//数据库对应字段 VRFRD
function getVRFRD(IpAdd) {
    var getDnnName = "";
    if (IpAdd != null && IpAdd != "") {
        getDnnName = IpAdd + ":100";
    }
    return getDnnName;
}

//取(upfList-greInfo-tunnelID)标准数据中【tunnelID（GRE TUNNEL标识）】
//数据库对应字段 TNLNAME
function getTNLNAME(tunnelID) {
    return tunnelID;
}

//取(upfList-greInfo-mainInterIpAdd)标准数据中的“mainInterIpAdd（隧道核心网侧主用隧道接口地址）】
//数据库对应字段 IFIPADDR_ipv4
function getIFIPADDR_ipv4(mainInterIpAdd) {
    return mainInterIpAdd;
}
function getMasks(terIpv4Add) {
    var getDnnName = "";
    if (terIpv4Add != null && terIpv4Add != "") {
        var split = [];
        split = terIpv4Add.split(",");
        for (var i = 0; i < split.length; i++) {
            var ipAdd1 = split[i];
            var split1 = ipAdd1.split("\/");
            var convertIpAdd1 = getMask(split1[1]);
            if (convertIpAdd1 == ""){
                continue;
            }
            getDnnName = getDnnName + convertIpAdd1 + ",";
        }
        return getDnnName.substring(0, getDnnName.length - 1);
    }
}
function getMask(masks) {
    if (masks == 1){
        return "128.0.0.0";
    }
    else if (masks == 2){
        return "192.0.0.0";
    }
    else if (masks == 3){
        return "224.0.0.0";
    }
    else if (masks == 4){
        return "240.0.0.0";
    }
    else if (masks == 5){
        return "248.0.0.0";
    }
    else if (masks == 6){
        return "252.0.0.0";
    }
    else if (masks == 7){
        return "254.0.0.0";
    }

    else if (masks == 8){
        return "255.0.0.0";
    }

    else if (masks == 9){
        return "255.128.0.0";
    }

    else if (masks == 10){
        return "255.192.0.0";
    }

    else if (masks == 11){
        return "255.224.0.0";
    }

    else if (masks == 12){
        return "255.240.0.0";
    }

    else if (masks == 13){
        return "255.248.0.0";
    }

    else if (masks == 14){
        return "255.252.0.0";
    }

    else if (masks == 15){
        return "255.254.0.0";
    }

    else if (masks == 16){
        return "255.255.0.0";
    }

    else if (masks == 17){
        return "255.255.128.0";
    }

    else if (masks == 18){
        return "255.255.192.0";
    }

    else if (masks == 19){
        return "255.255.224.0";
    }

    else if (masks == 20){
        return "255.255.240.0";
    }

    else if (masks == 21){
        return "255.255.248.0";
    }
    else if (masks == 22){
        return "255.255.252.0";
    }

    else if (masks == 23){
        return "255.255.254.0";
    }

    else if (masks == 24){
        return "255.255.255.0";
    }

    else if (masks == 25){
        return "255.255.255.128";
    }

    else if (masks == 26){
        return "255.255.255.192";
    }

    else if (masks == 27){
        return "255.255.255.224";
    }

    else if (masks == 28){
        return "255.255.255.240";
    }

    else if (masks == 29){
        return "255.255.255.248";
    }

    else if (masks == 30){
        return "255.255.255.252";
    }

    else if (masks == 31){
        return "255.255.255.254";
    }

    else if (masks == 32){
        return "255.255.255.255";
    }

    return "";
}
//数据库对应字段 IFIPmask_ipv4
function getIFIPmask_ipv4() {
    return "255.255.255.252";
}

//取(upfList-greInfo-userAddInfo-mainIpAdd)标准数据中的【mainIpAdd（主用GRE隧道客户侧网络地址）】字段
//数据库对应字段 DSTIPADDR
function getDSTIPADDR(DSTIPADDR) {
    return DSTIPADDR;
}

//数据库对应字段 TNLTYPE
function getTNLTYPE() {
    return "GRE隧道";
}

//根据(upfList-greInfo-keepaliveIs)标准数据“是否指定主备keepalive参数”，若为0：否，取值“去使能”；若为1：是，取值“使能”
//数据库对应字段 keepaliveIs
function getkeepaliveIs(keepaliveIs) {
    var getDnnName = "";
    if (keepaliveIs != null && keepaliveIs != "" && keepaliveIs == 1) {
        getDnnName = "使能";
    }
    if (keepaliveIs != null && keepaliveIs != "" && keepaliveIs == 0) {
        getDnnName = "去使能";
    }
    return getDnnName;
}

//取(upfList-greInfo-keepaliveIs)标准数据“是否指定主备keepalive参数”，若为1：是，取值为5；若为0：否不判断该字段
//数据库对应字段 Keepalive
function getKeepalive(keepaliveIs) {
    var getDnnName = "";
    if (keepaliveIs != null && keepaliveIs != "" && keepaliveIs == 1) {
        getDnnName = "5";
    }
    return getDnnName;
}

//取(upfList-greInfo-keepaliveIs)标准数据“是否指定主备keepalive参数””，若为1：是，取值为3；若为0：否不判断该字段
//数据库对应字段 Unreachable
function getUnreachable(keepaliveIs) {
    var getDnnName = "";
    if (keepaliveIs != null && keepaliveIs != "" && keepaliveIs == 1) {
        getDnnName = "3";
    }

    return getDnnName;
}

//取(upfList-greInfo-keepaliveIs)标准数据“是否指定主备keepalive参数”，若为1：是，取值“是”；若为0：否，取值“否”
//数据库对应字段 endTOend
function getendTOend(keepaliveIs) {
    var getDnnName = "";
    if (keepaliveIs != null && keepaliveIs != "" && keepaliveIs == 1) {
        getDnnName = "是";
    }
    if (keepaliveIs != null && keepaliveIs != "" && keepaliveIs == 0) {
        getDnnName = "否";
    }
    return getDnnName;
}

//数据库对应字段 route_AFTYPE
function getroute_AFTYPE() {
    return "IPv4单播";
}

//数据库对应字段 PREFERENCE
function getPREFERENCE() {
    return "60,61";
}

//数据库对应字段 PREFIX_ipv4
function getPREFIX_ipv4() {
    return "0.0.0.0";
}

//数据库对应字段 VPNINSTANCE
function getVPNINSTANCE() {
    return "VRF_N6_Internet_2B";
}

//数据库对应字段 HASVPNIPV6
function getHASVPNIPV6() {
    return "使能";
}

//数据库对应字段 SWITCH
function getSWITCH() {
    return "使能";
}

//数据库对应字段 SUPPORTIPV4
function getSUPPORTIPV4() {
    return "使能";
}

//数据库对应字段 SUPPORTIPV6
function getSUPPORTIPV6() {
    return "使能";
}

//数据库对应字段 FRAMEDROUTE
function getFRAMEDROUTE() {
    return "使能";
}

//数据库对应字段 ANTISPOOFINGDL
function getANTISPOOFINGDL() {
    return "不使能";
}

//数据库对应字段 ANTISPOOFINGUL
function getANTISPOOFINGUL() {
    return "使能 ";
}

//数据库对应字段 IPTYPEFORDUALIP
function getIPTYPEFORDUALIP() {
    return "IPV4V6";
}

//数据库对应字段 SINGLEADDRCAUSE
function getSINGLEADDRCAUSE() {
    return "1";
}

//数据库对应字段 CPCTRL
function getCPCTRL() {
    return "不使能";
}

//数据库对应字段 IPV6RAMTUSW
function getIPV6RAMTUSW() {
    return "不使能";
}

//数据库对应字段 IPV6RALIFETIME
function getIPV6RALIFETIME() {
    return "65535";
}

//数据库对应字段 HOSTROUTEIP
function getHOSTROUTEIP() {
    return "使能";
}

//获取createBusinessConfig下orderInfo中的snssai工单snssai字段原始数据
//数据库对应字段 ZX_SST_SD
function getZX_SST_SD(snssai) {
    return snssai;
}


//获取upfList-dnnInfoList工单DNN名称原始数据，DNN名称改为小写
//数据库对应字段 ZX_NETWORKINSTANCE
function getZX_NETWORKINSTANCE(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = DNNname.toLowerCase();
    }
    return getDnnName;
}
//获取upfList-dnnInfoList工单DNN名称原始数据，DNN名称改为小写
//数据库对应字段 ZX_NETWORKINSTANCE
function getZX_VRFNAME_ZJ(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = DNNname.toUpperCase();
    }
    return getDnnName;
}

//获取upfList-dnnInfoList工单DNN名称原始数据，DNN名称要大写，在前面加上固定字段 vpn.
//数据库对应字段 ZX_VRFNAME
function getZX_VRFNAME(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = "vpn." + DNNname.toUpperCase();
    }
    return getDnnName;
}

//数据库对应字段 ZX_MS2MSMODE
function getZX_MS2MSMODE() {
    return "INNERFORWARD";
}

//获取upfList-dnnInfoList工单DNN名称原始数据，DNN名称改为小写
//数据库对应字段 ZX_APNDNN
function getZX_APNDNN(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = DNNname.toLowerCase();
    }
    return getDnnName;
}

//数据库对应字段 ZX_REAL
function getZX_REAL() {
    return "是";
}

//获取upfList-dnnInfoList工单DNN名称原始数据，DNN名称改为小写
//数据库对应字段 ZX_REALAPNDNN
function getZX_REALAPNDNN(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = DNNname.toLowerCase();
    }
    return getDnnName;
}

//数据库对应字段 ZX_MAXPDPNUM
function getZX_MAXPDPNUM() {
    return "4294967295";
}

//获取(upfList-dnnInfoList-greInfo-terIpv4Name,terIpv6Name)标准的terIpv4Name和terIpv6Name数据，
//terIpv4Name
//数据库对应字段 ZX_terIpv4Name_greinfo_IPPOOLNAME
function getZX_terIpv4Name_greinfo_IPPOOLNAME(terIpv4Name) {
    return terIpv4Name;
}

//terIpv6Name
//数据库对应字段 ZX_terIpv6Name_greinfo_IPPOOLNAME
function getZX_terIpv6Name_greinfo_IPPOOLNAME(terIpv6Name) {
    return terIpv6Name;
}

//获取(upfList-dnnInfoList-natInfo-terIpv4Name,terIpv6Name)标准的terIpv4Name和terIpv6Name数据，
//terIpv4Name
//数据库对应字段 ZX_terIpv4Name_natInfo_IPPOOLNAME
function getZX_terIpv4Name_natInfo_IPPOOLNAME(terIpv4Name) {
    return terIpv4Name;
}

//terIpv6Name
//数据库对应字段 ZX_terIpv6Name_natInfo_IPPOOLNAME
function getZX_terIpv6Name_natInfo_IPPOOLNAME(terIpv6Name) {
    return terIpv6Name;
}

//获取(upfList-dnnInfoList-nonTunnelInfo-terIpv4Name,terIpv6Name)标准的terIpv4Name和terIpv6Name数据，
//terIpv4Name
//数据库对应字段 ZX_terIpv4Name_nonTunnelInfo_IPPOOLNAME
function getZX_terIpv4Name_nonTunnelInfo_IPPOOLNAME(terIpv4Name) {
    return terIpv4Name;
}

//terIpv6Name
//数据库对应字段 ZX_terIpv6Name_nonTunnelInfo_IPPOOLNAME
function getZX_terIpv6Name_nonTunnelInfo_IPPOOLNAME(terIpv6Name) {
    return terIpv6Name;
}

//数据库对应字段 ZX_PRIORITY
function getZX_PRIORITY() {
    return "1";
}

// 根据(upfList-dnnInfoList-greInfo-staIpAddIs)标准数据中的“是否静态地址”字段值判断。1的时候取值EXTENAL  0的时候取值LOCAL 。
//数据库对应字段 ZX_greinfo_IPPOOLATTR
function getZX_greinfo_IPPOOLATTR(staIpAddIs) {
    var getDnnName = "";
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 1) {
        getDnnName = "ASSIGNED";
    }
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 0) {
        getDnnName = "LOCAL";
    }
    return getDnnName;
}

// 根据(upfList-dnnInfoList-nonTunnelInfo-staIpAddIs)标准数据中的“是否静态地址”字段值判断。1的时候取值EXTENAL  0的时候取值LOCAL 。
//数据库对应字段 ZX_nonTunnelInfo_IPPOOLATTR
function getZX_greinfo_IPPOOLATTR(staIpAddIs) {
    var getDnnName = "";
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 1) {
        getDnnName = "ASSIGNED";
    }
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 0) {
        getDnnName = "LOCAL";
    }
    return getDnnName;
}

//数据库对应字段 ZX_natInfo_IPPOOLATTR
function getZX_natInfo_IPPOOLATTR() {
    return "LOCAL";
}

// 根据(upfList-dnnInfoList-greinfo-staIpAddIs)标准数据中的“是否静态地址”字段值判断。1的时候取值EXTENAL  0的时候取值LOCAL 。
//数据库对应字段 ZX_greinfo_NEEDDYNCROUTE
function getZX_greinfo_NEEDDYNCROUTE(staIpAddIs) {
    var getDnnName = "";
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 1) {
        getDnnName = "PERUSER";
    }
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 0) {
        getDnnName = "PUBLISH";
    }
    return getDnnName;
}

// 根据(upfList-dnnInfoList-nonTunnelInfo-staIpAddIs)标准数据中的“是否静态地址”字段值判断。1的时候取值EXTENAL  0的时候取值LOCAL 。
//数据库对应字段 ZX_nonTunnelInfo_NEEDDYNCROUTE
function getZX_nonTunnelInfo_NEEDDYNCROUTE(staIpAddIs) {
    var getDnnName = "";
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 1) {
        getDnnName = "PERUSER";
    }
    if (staIpAddIs != null && staIpAddIs != "" && staIpAddIs == 0) {
        getDnnName = "PUBLISH";
    }
    return getDnnName;
}

//数据库对应字段 ZX_natInfo_NEEDDYNCROUTE
function getZX_natInfo_NEEDDYNCROUTE() {
    return "PUBLISH";
}

function getIPTYPEName(terIpv4ADD, terIpv6ADD) {
    var getDnnName = "";
    if (terIpv4ADD != null && terIpv4ADD != "") {
        getDnnName = "IPV4";
    }
    if (terIpv6ADD != null && terIpv6ADD != "") {
        getDnnName = "IPV6";
    }
    return getDnnName;
}

//(upfList-greinfo-terIpv4ADD、terIpv6ADD)工单terIpv4ADD、terIpv6ADD值，
// 若只存在ipv4取值IPV4，若只存在ipv6取值IPV6，若ipv4和ipv6都存在，IPV4和IPV6都需要
//数据库对应字段 ZX_terIpv4Name_greinfo_IPTYPE
function getZX_terIpv4Name_greinfo_IPTYPE(terIpv4ADD) {
    return getIPTYPEName(terIpv4ADD, "");
}

//数据库对应字段 ZX_terIpv6Name_greinfo_IPTYPE
function getZX_terIpv6Name_greinfo_IPTYPE(terIpv6ADD) {
    return getIPTYPEName("", terIpv6ADD);
}

//(upfList-natInfo-terIpv4ADD、terIpv6ADD)工单terIpv4ADD、terIpv6ADD值，
// 若只存在ipv4取值IPV4，若只存在ipv6取值IPV6，若ipv4和ipv6都存在，IPV4和IPV6都需要
//数据库对应字段 ZX_terIpv4Name_natInfo_IPTYPE
function getZX_terIpv4Name_natInfo_IPTYPE(terIpv4ADD) {
    return getIPTYPEName(terIpv4ADD, "");
}

//数据库对应字段 ZX_terIpv6Name_natInfo_IPTYPE
function getZX_terIpv6Name_natInfo_IPTYPE(terIpv6ADD) {
    return getIPTYPEName("", terIpv6ADD);
}

//(upfList-nonTunnelInfo-terIpv4ADD、terIpv6ADD)工单terIpv4ADD、terIpv6ADD值，
// 若只存在ipv4取值IPV4，若只存在ipv6取值IPV6，若ipv4和ipv6都存在，IPV4和IPV6都需要
//数据库对应字段 ZX_terIpv4Name_nonTunnelInfo_IPTYPE
function getZX_terIpv4Name_nonTunnelInfo_IPTYPE(terIpv4ADD) {
    return getIPTYPEName(terIpv4ADD, "");
}

//数据库对应字段 ZX_terIpv6Name_nonTunnelInfo_IPTYPE
function getZX_terIpv6Name_nonTunnelInfo_IPTYPE(terIpv6ADD) {
    return getIPTYPEName("", terIpv6ADD);
}

//数据库对应字段 ZX_NFTRANSFERFLAG
function getZX_NFTRANSFERFLAG() {
    return "DISABLE";
}

//(upfList-upfName)工单UPF信息--ZX_UPNAME
function getZX_UPNAME(upfname) {
    return upfname;
}

//获取upfList-dnnInfoList工单DNN名称原始数据，DNN名称改为小写
//数据库对应字段 ZX_USERNAME
function getZX_USERNAME(DNNname) {
    var getDnnName = "";
    if (DNNname != null && DNNname != "") {
        getDnnName = "upg_" + DNNname.toLowerCase();
    }
    return getDnnName;
}

//数据库对应字段 ZX_USERPROFILETYPE
function getZX_USERPROFILETYPE() {
    return "本地规则";
}

//数据库对应字段 ZX_PRECEDENCE
function getZX_PRECEDENCE() {
    return "4294967295";
}

//数据库对应字段 ZX_DPIUPCONFIG
function getZX_DPIUPCONFIG() {
    return "DPIConfig_Nourlrerecog";
}

//数据库对应字段 ZX_RULENAME
function getZX_RULENAME() {
    return "defaultRule_l34，defaultRule_l7";
}

//(upfList-dnnInfoList-greInfo-tunnelID)固定字段gre_tunnel+工单中tunnelID数据
//数据库对应字段 ZX_gre_tunnelID
function getZX_gre_tunnelID(tunnelID) {
    var getDnnName = "";
    if (tunnelID != null && tunnelID != "") {
        getDnnName = "gre_tunnel" + tunnelID;
    }
    return getDnnName;
}

function getDNNSpecialname(vpnName) {
    var prex = "VPN_";
    if (vpnName == null || vpnName == undefined){
        return "";
    }
    return prex + vpnName;
}

function checkIsHeFa(staIpAddIs) {
    if (staIpAddIs == null || staIpAddIs == undefined){
        return "";
    }
    if (staIpAddIs == 1){
        return "不使能";
    }
    // 需要修改
    return "";
}

function getV6PREFIX(terIpv6Add) {
    if (terIpv6Add == null || !terIpv6Add.contains("/")) {
        return "";
    }
    var split = [];
    split = terIpv6Add.split(",");
    var res = "";
    for (var i = 0; i < split.length; i++) {
        var ipAdd = split[i];
        var index = ipAdd.indexOf("/");
        res += ipAdd.toString.substring(0, index) + ",";
    }
    return res.substring(0, getDnnName.length - 1);
}

function checkISHASV4V6Name(terIpv4Name, terIpv6Name) {
    if (terIpv4Name == null && terIpv6Name == null){
        return "";
    }
    if (terIpv4Name != null && terIpv6Name != null){
        return "IPv4单播,IPv6单播";
    }
    if (terIpv4Name == null && terIpv6Name != null){
        return "IPv6单播";
    }
    if (terIpv4Name != null && terIpv6Name == null){
        return "IPv4单播";
    }
    return "";
}

function getLUYOU(d1, d2) {
    if (d1 == null || d1 == undefined){
        return "";
    }
    if (d2 == null || d2 == undefined){
        return "";
    }
    return d1 + ":" + d2;
}

function getNAME(dnnName, vpnName) {
    if (dnnName == null || dnnName == undefined){
        return "";
    }
    if (vpnName == null || vpnName == undefined){
        return "";
    }
    var end = "-cmnet";
    var index = dnnName.toString().indexOf(".");
    var mod = dnnName.toString().substring(0, index).replaceAll("CMIOT5G");

    return vpnName + "-" + mod + end;
}

function dealDnnName(dnnName) {
    if (dnnName == '' || dnnName != undefined|| dnnName == null){
        return "";
    }
    var str = dnnName.toString().replaceAll(".","");
    str = str.toString().toLowerCase();
    return str;
}

function getVPNDEALName(vpnName) {
    if (vpnName == '' || vpnName != undefined|| vpnName == null){
        return "";
    }
    return "VPN_" + vpnName;
}

function getDataQUZGHI(vpnId) {
    if (vpnId == '' || vpnId != undefined|| vpnId == null){
        return "";
    }
    return "100GE66/0/9." + vpnId;
}